├── .editorconfig ├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── gridsome.config.js ├── netlify.toml ├── package-lock.json ├── package.json ├── posts ├── 2019-03-01-markdown-styling.md ├── 2019-03-02-deploying-your-site.md ├── 2019-03-02-getting-started.md ├── 2019-03-02-writing-posts.md └── dummy │ ├── adventures-sherlock-holmes.md │ ├── bob-ross-quotes.md │ ├── extraterrestrial-sightings.md │ ├── jeffsum.md │ ├── key-to-prototyping-tool.md │ └── sweetest-ipsum.md ├── scripts └── newPost.js ├── src ├── assets │ └── css │ │ ├── components │ │ ├── markdown.css │ │ └── resets.css │ │ └── main.css ├── components │ ├── Alert.vue │ ├── IndexHeader.vue │ ├── Pagination.vue │ ├── PostHeader.vue │ ├── PostItem.vue │ ├── PostsFilter.vue │ ├── PostsList.vue │ └── SiteFooter.vue ├── favicon.png ├── layouts │ └── Default.vue ├── main.js ├── pages │ ├── 404.vue │ ├── About.vue │ ├── Index.vue │ └── paginated │ │ └── Index.vue └── templates │ └── Post.vue ├── static └── images │ ├── briefly-card.png │ └── posts │ └── georgie-cobbs-467924-unsplash.jpg └── tailwind.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_size = 4 7 | end_of_line = lf 8 | indent_style = space 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.{css,js,json,vue}] 13 | indent_size = 2 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['https://paypal.me/cossssmin', 'https://www.amazon.co.uk/hz/wishlist/ls/3I8KTU4FLQIZ1'] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .cache 3 | .vscode 4 | src/.temp 5 | node_modules 6 | dist 7 | static/feed.xml 8 | 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Cosmin Popovici 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | 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. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Briefly 2 | 3 | > Minimal blog starter for [Gridsome](https://gridsome.org), based on [Dylan Smith's](https://dylanatsmith.com/) personal website design, and styled with [Tailwind CSS](https://tailwindcss.com). 4 | 5 | [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/cossssmin/gridsome-starter-briefly) 6 | 7 | ## Demo 8 | 9 | - [Page](https://gridsome-starter-briefly.netlify.com/about/) 10 | - [Single post](https://gridsome-starter-briefly.netlify.com/getting-started-with-gridsome-and-briefly/) 11 | - [Blog index with filtering](https://gridsome-starter-briefly.netlify.com/) 12 | - [Blog index with pagination](https://gridsome-starter-briefly.netlify.com/paginated/) 13 | 14 | ## Preview 15 | 16 | ![Briefly minimal blog starter for Gridsome preview](https://res.cloudinary.com/cossssmin/image/upload/v1559057477/os/gridsome/briefly/briefly-card.png) 17 | 18 | ## Features 19 | 20 | - Sitemap 21 | - RSS Feed 22 | - Google Analytics 23 | - Custom 404 Page 24 | - Code syntax highlighting 25 | - Medium-like image lightbox 26 | - Open Graph meta tags for posts 27 | - Alternative index page: [paginated posts list](https://gridsome-starter-briefly.netlify.com/paginated/) 28 | - Post descriptions: automatic or user-defined 29 | - Easily show post dates in your locale (moment.js) 30 | - _Index page post filtering_: show longer or shorter posts 31 | - Posts show a warning if they're older than 1 year (configurable) 32 | 33 | ## Installation 34 | 35 | It's recommended that you install Briefly with the `gridsome create` command, so that Gridsome removes the `.git` folder and installs NPM dependencies for you: 36 | 37 | ```sh 38 | gridsome create my-website https://github.com/cossssmin/gridsome-starter-briefly.git 39 | ``` 40 | 41 | Alternatively, you can clone this repo and set it up manually: 42 | 43 | ```sh 44 | git clone https://github.com/cossssmin/gridsome-starter-briefly.git my-website 45 | 46 | # navigate to the directory 47 | cd my-website 48 | 49 | # remove the Git folder 50 | rm -rf .git 51 | 52 | # install NPM dependencies 53 | npm install 54 | ``` 55 | 56 | ## Configuration 57 | 58 | See the [configuration notes](https://gridsome-starter-briefly.netlify.com/getting-started-with-gridsome-and-briefly/#configuration) in the Getting Started demo post. 59 | 60 | ## Development 61 | 62 | Run `gridsome develop` to start a local development server, or `gridsome build` to build the static site into the `dist` folder. 63 | 64 | See the [Gridsome docs](https://gridsome.org/docs) for more information. 65 | -------------------------------------------------------------------------------- /gridsome.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | siteName: 'A minimal blog starter for Gridsome', 3 | siteDescription: "Briefly is a minimal blog starter for Gridsome, the Vue.js static site generator. It's based on Dylan Smith's personal website design, and it's styled with Tailwind CSS.", 4 | siteUrl: 'https://gridsome-starter-briefly.netlify.com', 5 | titleTemplate: `%s | Briefly`, 6 | icon: 'src/favicon.png', 7 | 8 | transformers: { 9 | remark: { 10 | externalLinksTarget: '_blank', 11 | externalLinksRel: ['nofollow', 'noopener', 'noreferrer'], 12 | plugins: [ 13 | ['gridsome-plugin-remark-shiki', { 14 | theme: 'min-light' 15 | }] 16 | ] 17 | } 18 | }, 19 | 20 | plugins: [ 21 | { 22 | use: '@gridsome/source-filesystem', 23 | options: { 24 | path: 'posts/**/*.md', 25 | typeName: 'Post', 26 | } 27 | }, 28 | { 29 | use: '@gridsome/plugin-google-analytics', 30 | options: { 31 | id: 'UA-135446199-2' 32 | } 33 | }, 34 | { 35 | use: '@gridsome/plugin-sitemap', 36 | options: { 37 | cacheTime: 600000, // default 38 | } 39 | }, 40 | { 41 | use: 'gridsome-plugin-rss', 42 | options: { 43 | contentTypeName: 'Post', 44 | feedOptions: { 45 | title: 'Briefly, a Gridsome minimal blog starter', 46 | feed_url: 'https://gridsome-starter-briefly.netlify.com/feed.xml', 47 | site_url: 'https://gridsome-starter-briefly.netlify.com' 48 | }, 49 | feedItemOptions: node => ({ 50 | title: node.title, 51 | description: node.description, 52 | url: 'https://gridsome-starter-briefly.netlify.com/' + node.slug, 53 | author: '@cossssmin', 54 | date: node.date 55 | }), 56 | output: { 57 | dir: './static', 58 | name: 'feed.xml' 59 | } 60 | } 61 | }, 62 | ], 63 | 64 | templates: { 65 | Post: '/:title' 66 | }, 67 | 68 | chainWebpack: config => { 69 | config.module 70 | .rule('css') 71 | .oneOf('normal') 72 | .use('postcss-loader') 73 | .tap(options => { 74 | options.plugins.unshift(...[ 75 | require('postcss-import'), 76 | require('postcss-nested'), 77 | require('tailwindcss'), 78 | ]) 79 | 80 | return options 81 | }) 82 | }, 83 | } 84 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "dist" 3 | command = "npm run build" 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gridsome-starter-briefly", 3 | "private": true, 4 | "scripts": { 5 | "build": "gridsome build", 6 | "develop": "gridsome develop", 7 | "explore": "gridsome explore", 8 | "newpost": "node scripts/newPost.js" 9 | }, 10 | "dependencies": { 11 | "@fullhuman/postcss-purgecss": "^2.2.0", 12 | "@gridsome/plugin-google-analytics": "^0.1.1", 13 | "@gridsome/plugin-sitemap": "^0.3.0", 14 | "@gridsome/source-filesystem": "^0.6.2", 15 | "@gridsome/transformer-remark": "^0.6.0", 16 | "gridsome": "^0.7.15", 17 | "gridsome-plugin-remark-shiki": "^0.3.1", 18 | "gridsome-plugin-rss": "^1.2.0", 19 | "medium-zoom": "^1.0.5" 20 | }, 21 | "devDependencies": { 22 | "moment": "^2.26.0", 23 | "postcss-import": "^12.0.1", 24 | "postcss-nested": "^4.2.1", 25 | "tailwindcss": "^1.4.6" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /posts/2019-03-01-markdown-styling.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Markdown styling" 3 | description: "Markdown post content stress test. See how your post content is being styled with Tailwind CSS." 4 | date: 2019-02-27 17:54:43 5 | --- 6 | 7 | **Blog posts in Briefly are written using Markdown. However, you are free to use HTML inside Markdown, for any elements not covered by the spec.** 8 | 9 | Markdown is intended to be as easy-to-read and easy-to-write as is feasible.Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions. 10 | 11 | **Haxx0r** ipsum _then_ less spoof ifdef ~~boolean~~ bang injection while it's a _**feature**_. Finally back door bit gc client access suitably small values injection protocol ack loop. Bang public echo baz server packet sniffer syn cd. 12 | 13 | Frack highjack float buffer [function protocol](https://gridsome.org) I'm compiling. Root leet all your base are belong to us char protected ascii *.* regex semaphore root bin ip snarf foo Linus Torvalds. Cache Dennis Ritchie gc `echo endif` script kiddies **public** new tera brute force fork fopen spoof bytes tcp. 14 | 15 | ## Heading 2 16 | ### Heading 3 17 | #### Heading 4 18 | ##### Heading 5 19 | ###### Heading 6 20 | 21 | Heading 1 is the title of this page. You should only use it once in a document. 22 | 23 | ## Links 24 | 25 | When you paste in a URL like so: https://gridsome.org, it will be automatically converted to a link. Otherwise, you can use the standard `[link text](https://...)` markdown to create a link. 26 | 27 | ## Ordered list 28 | 29 | 1. python 30 | 2. root 31 | 3. public 32 | 4. bypass 33 | 34 | ## Unordered list 35 | 36 | - boolean 37 | - stack 38 | - foad 39 | - tarball 40 | 41 | ## A definition list 42 | 43 | This list is created using `
`, `
`, and `
` HTML tags. 44 | 45 |
46 |
First Term
47 |
This is the definition of the first term.
48 |
Second Term
49 |
This is one definition of the second term.
50 |
This is another definition of the second term.
51 |
52 | 53 | ## Blockquotes 54 | 55 | > Trojan horse protected afk finally irc ip new kilo fork boolean. Int ack long less lib crack emacs gnu foo *.* segfault suitably small values ascii rsa throw void I'm sorry Dave 56 | 57 | ## Code 58 | 59 | ### Fenced codeblocks 60 | 61 | Briefly uses [gridsome-plugin-remark-shiki](https://github.com/EldoranDev/gridsome-plugin-remark-shiki) to add syntax highlighting to code blocks. Roll with the default light one, or choose one of the other [themes available](https://github.com/octref/shiki/tree/master/packages/themes). 62 | 63 | ```vue 64 | 70 | 71 | 80 | 81 | 90 | ``` 91 | 92 | Of course, it also styles `inline code blocks`. 93 | 94 | ## Images 95 | 96 | Here's a local image, that opens in a lightbox: 97 | 98 | ![iMac rear photo by Georgie Cobbs on Unsplash](/images/posts/georgie-cobbs-467924-unsplash.jpg) 99 | 100 | As you just saw, Gridsome loads it only when it enters your viewport. 101 | 102 | Here's an external image, hotlinked from Unsplash and linked to its page there: 103 | 104 | [![Window photo by Mirna Rivalta on Unsplash](https://images.unsplash.com/photo-1551107671-b3ce56b6c667?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&h=360&q=80)](https://unsplash.com/photos/UecFf82b1qo) 105 | 106 | As you can see, the lightbox is not used for linked images. Also, if the URL they link to is external, it will open in a new tab - just like the one above. 107 | -------------------------------------------------------------------------------- /posts/2019-03-02-deploying-your-site.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Deploying your site" 3 | description: "How to deploy and host your static site" 4 | date: 2019-02-25 18:23:53 5 | --- 6 | 7 | Seriously, this is a static site. 8 | 9 | You could just run `gridsome build` and then upload the entire `dist` folder to any web host. 10 | 11 | ## Deploy to Netlify 🔥 12 | 13 | Simply connect Netlify to your GitHub repo and trigger a site rebuild every time you push to `master`. 14 | Click this wonderful button to get started: 15 | 16 | [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/cossssmin/gridsome-starter-briefly) 17 | 18 | ## Other services 19 | 20 | For other services, such as GitLab Pages or Amazon S3, checkout the [Gridsome deploy docs](https://gridsome.org/docs/deploy-to-amazon-s3). 21 | -------------------------------------------------------------------------------- /posts/2019-03-02-getting-started.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Getting started" 3 | slug: getting-started-with-gridsome-and-briefly 4 | description: "Getting started with the Briefly minimal blog starter theme for the Gridsome static site generator" 5 | date: 2019-03-01 14:43:24 6 | --- 7 | 8 | **Briefly** is a minimal blog starter theme for Gridsome, based on the design of the [Dylan Smith's](https://dylanatsmith.com/) personal website, and styled with [Tailwind CSS](https://tailwindcss.com). 9 | 10 | [Gridsome](https://gridsome.org) is a Vue.js-powered, modern site generator for building the fastest possible websites for any Headless CMS, APIs or Markdown-files. Gridsome makes it easy and fun for developers to create fast, beautiful websites without needing to become a performance expert. 11 | 12 | 13 | ## Installation 14 | 15 | After installing Gridsome, run: 16 | 17 | ``` 18 | gridsome create my-website https://github.com/cossssmin/gridsome-starter-briefly.git 19 | ``` 20 | 21 | Then, `cd my-website` and `gridsome develop` to start a local development server. 22 | 23 | Alternatively, you can clone or download the [repo on GitHub](https://github.com/cossssmin/gridsome-starter-briefly). 24 | 25 | ## Features 26 | 27 | - Sitemap 28 | - RSS Feed 29 | - Google Analytics 30 | - Custom [404 Page](/404/) 31 | - Code syntax highlighting 32 | - Medium-like image lightbox 33 | - Open Graph meta tags for posts 34 | - Alternative index page: [paginated posts list](/paginated/) 35 | - Post descriptions: automatic or user-defined 36 | - Easily show post dates in your locale (moment.js) 37 | - _Index page post filtering_: show longer or shorter posts 38 | - Posts show a warning if they're older than 1 year (configurable) 39 | 40 | ## Configuration 41 | 42 | You'll need to change some Briefly defaults before deploying your own site. 43 | 44 | #### Sitemap 45 | 46 | Briefly uses Gridsome's official sitemap plugin. Simply change the default `siteUrl` in `gridsome.config.js`, and you're all set: 47 | 48 | ```js 49 | siteUrl: 'https://gridsome-starter-briefly.netlify.com', 50 | ``` 51 | 52 | When you build the site, a `sitemap.xml` will be automatically generated at the root of your site. 53 | Read more in the [plugin's documentation](https://gridsome.org/plugins/@gridsome/plugin-sitemap). 54 | 55 | #### RSS Feed 56 | 57 | Update the feed title and all the default URLs, in `gridsome.config.js`: 58 | 59 | ```js 60 | { 61 | use: 'gridsome-plugin-rss', 62 | options: { 63 | contentTypeName: 'Post', 64 | feedOptions: { 65 | title: 'Briefly, a Gridsome minimal blog starter', // <- update 66 | feed_url: 'https://gridsome-starter-briefly.netlify.com/feed.xml', // <- update, leave the file name 67 | site_url: 'https://gridsome-starter-briefly.netlify.com' // <- update 68 | }, 69 | feedItemOptions: node => ({ 70 | title: node.title, 71 | description: node.description, 72 | url: 'https://gridsome-starter-briefly.netlify.com/' + node.slug, // <- update 73 | author: '@cossssmin', 74 | date: node.date 75 | }), 76 | output: { 77 | name: 'feed.xml' // <- if you change this, also change it in the `feed_url` above 78 | } 79 | } 80 | }, 81 | ``` 82 | 83 | #### Google Analytics 84 | 85 | If you want to use Google Analytics, make sure to change the default tracking code in `gridsome.config.js`: 86 | 87 | ```js 88 | { 89 | use: '@gridsome/plugin-google-analytics', 90 | options: { 91 | id: 'UA-135446199-2' // <- change this 92 | } 93 | } 94 | ``` 95 | 96 | To disable GA, simply comment out or delete that entire code block. 97 | 98 | ## Customisation 99 | 100 | #### Post filtering 101 | 102 | Post filtering is done in the `filterPosts()` method from `pages/Index.vue`. 103 | 104 | Posts are considered to be "longer" if they're over 1000 characters. Otherwise, they're considered "shorter". 105 | 106 | You can customise the text and styling by editing the `components/PostsFilter.vue` file. 107 | 108 | #### Old content alert 109 | 110 | Posts that are over one year old will show a warning like this one: 111 | 112 | 115 | 116 | This is a flexible alert component, defined in `/src/components/Alert.vue`. 117 | 118 | Usage: 119 | 120 | ```vue 121 | 122 | 127 | ``` 128 | The `postIsOlderThanOneYear` computed property uses `moment.js`, so you can customise it to any date you need. 129 | Style it like you would normally style any element, by adding a `class=""` attribute and using Tailwind utility classes. 130 | 131 | #### Post dates in your language 132 | 133 | Open `/src/components/PostItem.vue` and `import` your [locale](https://github.com/moment/moment/tree/develop/locale "List of all moment.js locales") after the `moment` import: 134 | 135 | ```vue 136 | 144 | ``` 145 | 146 | For the single post view, do the same in `/src/templates/Post.vue`. 147 | 148 | #### Advanced customisation 149 | 150 | The [Gridsome documentation](https://gridsome.org/docs) is a great place to start. You will need to be familiar with Vue.js, mostly. Tailwind CSS is very easy to pick up. For advanced customisation, you'll also need a bit of experience with GraphQL. 151 | -------------------------------------------------------------------------------- /posts/2019-03-02-writing-posts.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Writing posts" 3 | slug: writing-posts-markdown 4 | description: "Writing posts in Markdown with Briefly for Gridsome" 5 | date: 2019-02-28 15:16:11 6 | --- 7 | 8 | The starter uses Gridsome's filesystem source plugin, which means blog posts are Markdown files that exist in the `/content/posts` directory. 9 | 10 | ## Creating a new post 11 | 12 | There are 2 ways you can create a new post with Briefly: 13 | 14 | 1. Simply add a new, uniquely-named `*.md` file in the `/content/posts` directory 15 | 2. In your terminal, navigate to the project root and run this command: 16 | 17 | ```sh 18 | npm run newpost "My post title" 19 | ``` 20 | 21 | The quotes around the title are mandatory. 22 | 23 | This will create a new file named `YYYY-MM-DD-my-post-title.md` under `/content/posts`. 24 | 25 | ## Supported Front Matter keys 26 | 27 | You can use the following Front Matter keys when creating a post: 28 | 29 | ```yaml 30 | --- 31 | title: "Post title" # required 32 | slug: post-title-custom-url # optional, override the auto-generated post slug 33 | description: "Lorem ipsum description sit amet" # required, used in meta tags and RSS feed 34 | date: 2019-03-01 17:54:43 # only date is required; time is optional, but recommended for the