Skip to content

Commit 9b5bceb

Browse files
committed
Merge remote-tracking branch 'template/main'
2 parents 09f9f55 + 6db961d commit 9b5bceb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+35637
-9
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintrc.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
root: true,
3+
4+
env: {
5+
"node": true,
6+
"jest": true
7+
},
8+
9+
extends: [
10+
'plugin:vue/recommended',
11+
'plugin:prettier/recommended',
12+
"prettier/vue",
13+
],
14+
15+
parserOptions: {
16+
parser: 'babel-eslint' // Support dynamic import
17+
},
18+
19+
rules: {
20+
'no-undef': ['error'],
21+
22+
'vue/match-component-file-name': [
23+
'error',
24+
{
25+
extensions: ['js', 'vue'],
26+
shouldMatchCase: false
27+
}
28+
],
29+
30+
'vue/prop-name-casing': 0,
31+
32+
'vue/require-default-prop': 0
33+
},
34+
35+
36+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.github/workflows/deploy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and Deploy
2+
on: [push, repository_dispatch]
3+
jobs:
4+
build-and-deploy:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout self
8+
uses: actions/checkout@master
9+
10+
- name: Checkout blog
11+
uses: actions/checkout@v2
12+
with:
13+
repository: ${{ secrets.REPO_BLOG }}
14+
token: ${{ secrets.REPO_BLOG_ACCESS_TOKEN }}
15+
path: blog
16+
17+
- name: Get yarn cache directory path
18+
id: yarn-cache-dir-path
19+
run: echo "::set-output name=dir::$(yarn cache dir)"
20+
21+
- name: Move blog/public/ to blog/.vuepress/
22+
run: mv -f blog/public/ blog/.vuepress/public/
23+
24+
- uses: actions/cache@v4
25+
id: yarn-cache
26+
with:
27+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
31+
32+
- name: vuepress-deploy
33+
uses: jenkey2011/vuepress-deploy@master
34+
env:
35+
ACCESS_TOKEN: ${{ secrets.REPO_HOSTING_ACCESS_TOKEN }}
36+
TARGET_REPO: ${{ secrets.REPO_HOSTING }}
37+
TARGET_BRANCH: main
38+
BUILD_SCRIPT: yarn && yarn build
39+
BUILD_DIR: blog/.vuepress/dist/
40+
CNAME: ${{ secrets.CNAME }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Update template
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
update-template:
6+
runs-on: ubuntu-22.04
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: actions-template-sync
14+
uses: AndreasAugustin/actions-template-sync@v2
15+
with:
16+
source_gh_token: ${{ secrets.GITHUB_TOKEN }}
17+
source_repo_path: rodber/mediumish
18+
upstream_branch: main

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
.DS_Store
2+
.temp
3+
/node_modules
4+
/dist
5+
/blog

.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
semi:false,
3+
singleQuote: true,
4+
tabWidth: 2,
5+
trailingComma: 'es5',
6+
}

LICENSE

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) 2021 Rodolfo Berrios
3+
Copyright (c) wowthemesnet <wowthemesnet@gmail.com> (https://github.com/wowthemesnet)
4+
Copyright (c) 2020 Rodolfo Berrios <inbox@rodolfoberrios.com>
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
910
copies of the Software, and to permit persons to whom the Software is
1011
furnished to do so, subject to the following conditions:
1112

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
1415

1516
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1617
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1718
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1819
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1920
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

Lines changed: 164 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,166 @@
1-
# Mediumish Blog
1+
# Mediumish
22

3-
Markdown blog template for `rodber/mediumish`.
3+
> _The Rodo Fork_ of `wowthemesnet/mediumish-vuepress-blog-theme` with super powers.
44
5-
This repo is intended to be used as a template for your own markdown blog repo.
5+
It takes a markdown blog repo and generates a VuePress app that can be configured to be automatically published to GitHub pages.
6+
7+
[View Demo](https://rodolfoberrios.com/)
8+
9+
## Requirements
10+
11+
- A markdown blog repository following a simply scheme (example [rodolfoberrios/blog](https://github.com/rodolfoberrios/blog/)).
12+
13+
### Tree for blog repo
14+
15+
```shell
16+
./
17+
├── .github
18+
│ └── workflows
19+
│ └── push-deploy.yml
20+
├── _posts
21+
│ └── 2020-07-09-a-post.md
22+
├── public
23+
│ ├── avatars
24+
│ │ └── user.jpg
25+
│ ├── icons
26+
│ │ ├── android-chrome-192x192.png
27+
│ │ └── android-chrome-512x512.png
28+
│ ├── logo.png
29+
│ ├── manifest.json
30+
│ └── photos
31+
│ └── some-photo.jpg
32+
└── .vuepress
33+
├── config.js
34+
├── enhanceApp.js
35+
└── styles
36+
├── index.styl
37+
└── palette.styl
38+
```
39+
40+
### `.github/` folder
41+
42+
Read [Deploying to GitHub pages](#deploying-to-github-pages).
43+
44+
### `_posts/` folder
45+
46+
Contains the posts of the target blog source.
47+
48+
- ⚠ Post name must be in the format `YYYY-MM-DD-<name_here>.md`
49+
- ⚠ Post must link internal resources using absolute path (Use `/` to map to [`public/` folder](#public-folder))
50+
51+
Posts use [Front Matter](https://jekyllrb.com/docs/front-matter/) to provide meta:
52+
53+
```md
54+
---
55+
date: 2020-07-09 11:32:02 GMT
56+
title: Vuelvo a bloguear
57+
tags:
58+
- ✊🏾resurrecting
59+
author: Rodolfo
60+
summary: Vuelvo a renacer, amado pueblo... Se siente tan vacío sin mi!
61+
image: /photos/image.jpg
62+
feed:
63+
description: Description used in feed
64+
image: /photos/image-alt.jpg
65+
---
66+
```
67+
68+
### `public/` folder
69+
70+
Public folder for logos, icons and manifest files that maps to the root. For example, `public/logo.png` will be available at `/logo.png` in the deployed app.
71+
72+
### `.vuepress/` folder
73+
74+
Contains `config.js`, `enhanceApp.js` and `styles/` used by VuePress. These allow to configure your blog name, links, authors and allow to define the colors used by the theme.
75+
76+
## Deploying to GitHub pages
77+
78+
Requirements:
79+
80+
- A GitHub repository for hosting (see [GitHub pages](https://pages.github.com/)).
81+
82+
### Require Secrets (on deploy repo)
83+
84+
> 🧔🏾 Your own clone of this repo is the deploy repo of yours.
85+
86+
- `REPO_BLOG` example [`rodolfoberrios/blog`](https://github.com/rodolfoberrios/blog/)
87+
- `REPO_BLOG_ACCESS_TOKEN` token for the repo above
88+
- `REPO_HOSTING` example `rodolfoberrios/rodolfoberrios.github.io`
89+
- `REPO_HOSTING_ACCESS_TOKEN` token for the repo above
90+
- `CNAME` example `rodolfoberrios.com`
91+
92+
### Require Secrets (on blog repo)
93+
94+
> 🧔🏾 Your own repo with your markdown files is the blog repo of yours.
95+
96+
- `REPO_BLOG_DEPLOY` the repo used for deploy example `rodolfoberrios/mediumish`
97+
- `REPO_BLOG_DEPLOY_USERNAME` username with access to blog deploy repo
98+
- `REPO_BLOG_DEPLOY_TOKEN` PAT for the username above
99+
100+
> ⚠ The personal access token must grant access to `repo` scope.
101+
102+
Configure the blog repo to **automatically trigger** a new deploy by adding `.github/workflows/push-deploy.yml` in the blog repo.
103+
104+
```yml
105+
name: Push deploy
106+
on: push
107+
jobs:
108+
push-deploy:
109+
runs-on: ubuntu-latest
110+
steps:
111+
- name: Push it
112+
run: |
113+
curl -XPOST -u "${{ secrets.REPO_BLOG_DEPLOY_USERNAME }}:${{ secrets.REPO_BLOG_DEPLOY_TOKEN }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${{ secrets.REPO_BLOG_DEPLOY }}/dispatches --data '{"event_type": "build_application"}'
114+
```
115+
116+
## Deploying with shell
117+
118+
- Requires [yarn](https://yarnpkg.com/).
119+
120+
Install all the dependencies.
121+
122+
```sh
123+
yarn
124+
```
125+
126+
Copy `config.sh.dist` to `config.sh`.
127+
128+
```sh
129+
cp config.sh.dist config.sh
130+
```
131+
132+
Change the variables in `config.sh` to match the target project. In this file you will configure the repositories for blog sourcing and hosting.
133+
134+
### Shell commands
135+
136+
Make sure that `deploy.sh` is executable.
137+
138+
```sh
139+
chmod +x deploy.sh
140+
```
141+
142+
Command syntax:
143+
144+
```sh
145+
./deploy.sh <to> <doSource>
146+
```
147+
148+
`<to>` deploy options:
149+
150+
| Option | Effect |
151+
| ------ | --------------------- |
152+
| `dev` | Deploys dev preview |
153+
| `prod` | Deploys to production |
154+
155+
`<doSource>` option:
156+
157+
| Option | Effect |
158+
| ------- | ----------------------------------------------- |
159+
| `true` | Source `blog/` from the target blog repo |
160+
| `false` | Skip the blog sourcing (will use local `blog/`) |
161+
| `dir` | Use target dir as `blog/` source (copied) |
162+
163+
## Known bugs
164+
165+
- 🤷🏾 Feeds won't work in `dev`, only in `build`.
166+
- ⚠ Posts markdown files, (`YYYY-MM-DD-<name_here>.md`) must not start with a digit at `name_here`. No idea why the `service-worker` breaks on those.

components/Avatar.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<template>
2+
<div v-if="$themeConfig.authors">
3+
<span v-for="author in $themeConfig.authors" :key="author.name">
4+
<div class="d-flex align-items-center">
5+
<div class="profile-avatar">
6+
<img
7+
v-if="author.name === $frontmatter.author"
8+
:src="$withBase(author.avatar)"
9+
class="avatar-image"
10+
:alt="author.name"
11+
/>
12+
</div>
13+
<div v-if="author.name === $frontmatter.author">
14+
<span>{{ author.name }}</span> &nbsp;
15+
<NavLink
16+
v-if="author.name === $frontmatter.author"
17+
:link="author.link"
18+
class="btn btn-sm btn-outline-dark"
19+
>{{ author.linktext }}</NavLink
20+
>
21+
</div>
22+
</div>
23+
</span>
24+
</div>
25+
</template>

0 commit comments

Comments
 (0)