Giter Site home page Giter Site logo

vuelog's Introduction

Vuelog

ES2015+ CircleCI Codecov Release License

A backend-free blog system built on top of Vue.js

Browsers Support

Chrome
Chrome
Edge
Edge
Firefox
Firefox
Opera
Opera
Safari
Safari
Internet Explorer
Internet Explorer
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔ 11 ✘

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Run your unit tests

npm run unit

Customize configuration

See Configuration Reference.

Documentation

https://vuelog.js.org/

Changelog

https://vuelog.js.org/#/page/changelog/

License

MIT

Copyright (c) 2016-2019 Leo Deng

vuelog's People

Contributors

cwang22 avatar dnmct avatar gabrielcoelho avatar myst729 avatar ocampogeric avatar peakfish avatar swhgoon avatar xiaoyual666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vuelog's Issues

# in URL and SEO

Hey thank's for the back end it's very usefull !
But i have a question, we got url like .../#/home/... is that not a problem for good SEO ?

Thank's again :)

add getting started instructions

Is there a starter template like vue cli for the project or can we integrate vuelog into vue-cli apps?

I see that there are download links. Does this mean the usual workflow to start a new vuelog project is to clone this entire repository or is there a template with the files described in the file structure section?

hosting on github pages

I have a repo here for building a blog: https://github.com/connor11528/vuelog-starter/tree/gh-pages

I have pushed the repo up to a new gh-pages branch and set the base in my database.js file.

    // Path to the domain root that serves your site, starts and ends with slash (`/`).
    // Set to `'/'` if your site is under domain root.
    base: '/vuelog-starter/', 

I then ran yarn build

When I push up the code the website shows a Loading... page instead of the compiled application. It looks like the full static build is hosted in the docs folder.

How do I render my vuelog blog on gh-pages?

pt-BR Translation

Presentation

Hello, I'm Gabriel Coelho Soares, I live in Brazil, born and raised here. I'm a web developer by love and I was searching for static site generators builds with Vue and end up here.
Loved the idea and started to translate all the documentation provided in the website.
By now, I've already translated all the posts and, as here in Brazil it is 03:14 o'clock, I have to sleep and I'll continue the translation tomorrow.

I really want to learn Vue, and I have a little conference here in my city this saturday (18) which the subject is "Creating VueJS Applications" (That's why I was searching for static site generators).

So, by now, I cannot help much on the development, but any new documentation post, I'll translate!

About the Pul Request

I'm gonna do a PR now, only with the /posts and database.js file. I'll keep going with pages and I'm pretty sure that before 13:30 here in Brazil (GMT -2) that will be finished.

Have a nice day 👍

bitmoji

关于Hexo与Vue

博主以前是用Hexo的,不知是否也曾考虑过将Vue融合到Hexo中呢?
是否由于Hexo本身结构的问题,而无法实现呢?

Running dev-server on different host/port?

Adding this as a note for future visitors. To change the host and/or port start the development server using one of the following commands:

# different host only
npm run dev -- --host 0.0.0.0

# different port only
npm run dev -- --port 8086

# different host and port
npm run dev -- --host 0.0.0.0 --port 8086

Prismjs with color theme option

Hi @myst729, I'm trying to add multi theme support in Vuelog by defined database.js attribute, but I can't get it work.

I tried with import css, and doesn't work.
Can you say me, where you define de default theme? I can't understand 😢

P.S. I notice you change highlight to prismjs, I use in my personal site 2.11.1 and in that case I change styles directly, but now I want add this option by attribute.

better docs

Current docs are too naive and out of date. Need to rewrite.

Supported features till version 2.8.0:

  • Customizable logo and favicon.
  • Customizable homepage.
  • Customizable navigation menu.
  • Syntax highlight for code snippets.
  • Social commenting services integration (Disqus, LiveRe, IntenseDebate).
    • Disable comments for a specific page or post.
  • Internationalization support.
    • Support for UI (new translations are welcome!).
    • Support for user content (except comments, which are third party hosted).
    • Switch language on the fly.
  • Exclude a specific page from archive view.
  • Store a page or post as draft (can not be visited from UI).
  • Hide title for a specific page or post.
  • Post excerpt in list view.
  • Content pagination for long pages/posts.

Pages and menus autogenerate entries?

Have been looking at a few node cms/blog options. What I am wondering about with Vuelog is why we need to manually add pages and menu items in a database file. Other systems just generate these from markdown metadata. Look say at Gatsby.
For the rest it looks like a compelling system.

Is there a way to auto-detect posts and pages?

Hi, I love this vuelog project very much! It's doing the dream way for generating blog & posts. I wander if there is a way to auto-detect posts and pages and no need to manually modify the database.js file. That would be more convenient for add a post or page. Only add a .md file and nothing else to care about.
Besides, I think vuelog is better than vuepress.

Support content pagination for pages/posts.

Scenario

Sometimes we write super long articles. Too much content in a single web page might not be easy to read.

Plan

Allow to insert pagination tags in a page/post content, which split the content into multiple pages. Use <!-- next --> by default, also customizable.

Effect

Something similar to <!--nextpage--> in WordPress.

tutorial draft

Hello there,

I wrote a tutorial for getting started with Vuelog, included below. It seems that to start a new project the best course of action is to clone the repo and delete many of the contents? This post is meant to outline how to get started building a blog with Vue and Vuelog, feedback appreciated


Build a static blog with Vue.js and Vuelog

In this tutorial we are going to go through building a static blogging application with Vuelog. Vuelog is built out of Vue.js and uses the marked markdown parser and compiler under the hood. This means that we get the full reactivity power of Vue 2 and Vuex and the simplicity of writing our posts in markdown format. Vuelog was created in China and takes internationalization very seriously. If you have readers that speak different languages Vuelog is an especially good static blogging choice. Under the hood Vuelog uses vue-i18n to render different language content based on the user's preferences.

The application

A static blogging application means that all of our content is hosted on the client side. We do not need a server to handle incoming requests or a database like MySQL or MongoDB to store our content. Instead our application will be made up entirely of HTML, CSS and Javascript. This decreases our hosting costs, can increase performance and simplify our application.

This blog application will feature pages for our portfolio work, an about page and a blog. Additionally, we will have an archive of posts grouped by year and category as well as social links. The application will be hosted live using Github Pages. The source code for the application and a demo are featured below.

Demo: http://connorleech.info/vuelog-starter/

Source code: https://github.com/connor11528/vuelog-starter

Alternatives

There are many other solutions for static blogging out there. One to keep an eye on for the Vue.js community is called [Nuxt]
(https://github.com/nuxt/nuxt.js). It is very powerful and includes many additional features. However, it is not stable and has not yet released the 1.0 release yet. Additionally, the added features can introduce uncessary complexity into our application.

Hexo.js, gatsby and jekyll are alternative static blogging engines that do not use Vue.js.

Get started building

To start building a new Vuelog project you must fork or clone the Vuelog repository, install dependencies and then run the development server using the steps below:

$ git clone https://github.com/myst729/Vuelog.git my-repo-name
$ cd my-repo-name && npm install 
$ npm run dev 

The application will run on localhost:8080.

Vuelog starting point

Customize our blog

The starting point for a new Vuelog project comes with a lot of boilerplate code. In order to get our own blog up and running we'll have to delete and refactor.

Most of the configuration happens in userdata/database.js and the userdata folder also holds our markdown posts.

The two sections to pay attention to are navigation and pages. We will update these values to reflect our custom blog structure:

// The image displayed in site header right beside the brand.
logo: './static/employbl_logo.png',

...


navigation: [
    {
      label: {'en-US': 'Work' },
      type: 'page',
      path: '/page/work'
    },
    {
      label: {'en-US': 'About' },
      type: 'page',
      path: '/page/about'
    },
    {
      label: {'en-US': 'Blog' },
      type: 'category',
      path: '/blog'
    },
    {
      label: {'en-US': 'Archive' },
      type: 'archive',
      path: '/archive'
    },
    {
      label: {'en-US': 'Links' },
      type: 'dropdown',
      path: '', // (OPTIONAL) dropdown can be routable too if you set a valid route path
      children: [
        {
          label: {'en-US': 'LinkedIn' },
          type: 'outgoing', // A plain link can redirect to an in-site route or an out-going URL
          link: 'http://linkedin.com/in/connorleech'
        },
        {
          label: 'GitHub',
          type: 'outgoing',
          link: 'https://github.com/connor11528'
        },
        {
          label: 'Twitter',
          type: 'outgoing',
          link: 'https://stackoverflow.com/users/1032492'
        }
      ]
    }
  ],

  pages: [
    {
      title: {'en-US': 'Work'},
      slug: 'work', // corresponds to markdown file name
      exclude: true,      // (OPTIONAL) `true` to exclude the page from archive view
      titleless: false,   // (OPTIONAL) `true` to hide the title in page view
      commentless: true, // (OPTIONAL) `true` to disable comments for the page
      draft: false        // (OPTIONAL) `true` to make the page temporarily inaccessible
    },
    {
      title: {'en-US': 'About'},
      slug: 'about',
      exclude: true,
      titleless: false,   // (OPTIONAL) `true` to hide the title in page view
      commentless: true, // (OPTIONAL) `true` to disable comments for the page
    }
  ],

The value for slug in the pages array maps to the title of the markdown file we define in userdata/pages/. This configuration file serves as a source of truth for defining the structure of our blog application. We can also dynamically define our navigation menu and update the header image. Static assets are stored in the static/ directory.

Create an example post

Now that we have defined the pages and navigation we'd like in out application we can create a new post called userdata/posts/2017/sample.md:

title: This is a sample title
category: docs
date: 2017-09-22
------------------------------------
Welcome to the **sample** post written in *markdown*!

<!-- zh-CN:+ -->  
This will show if the language is set to Mandarin

<!-- zh-CN:- -->

Including the metadata in the post title itself is optional but can be helpful down the line.

We then add that post to our array of posts in userdata/database.js:

  posts: [
    /* 2017 */
    {
      title: {'en-US': 'This is a sample title'},
      slug: 'sample',
      category: 'docs',
      date: '2017-09-22'
    },
    ...

Deploy to Github Pages

Create a github repo for your project and set the base path in userdata/database.js to the name of your github repo:

base: '/name-of-github-repo/',

In order to deploy our application we first have to compile all of our vue files and assets. This command is defined in our package.json file and can be invoked by running: npm run build in the terminal. This generates our production application code into the docs folder.

Initialize a git repository for the project and commit all changes:

$ git init 
$ git add -A 
$ git commit -m 'initial commit'
$ git remote add orgin YOUR_GITHUB_HTTPS_OR_SSH_URL 
$ git push origin master 

Once we have built out our code we're going to reformat for production and push to the gh-pages branch.

$ git checkout -b gh-pages 
$ rm -rf static userdata
$ mv docs/* .

The above commands create a gh-pages branch, removes the static and userdata directories and then moves our production build folder from docs into their place. We are doing this because for the gh-pages branch we want the production build to be at root level.

If we make changes to our master branch and would like to redploy we can delete the gh-pages branch with the below command and deploy again according to the above process.

$ git push -d origin gh-pages
$ git branch -d gh-pages
$ git branch

Conclusion

Vuelog is a powerful tool for rendering a markdown blog with Vue.js. Under the hood it parses markdown and generates our application from a centralized configuration repository. The Vue.js source code is familiar and gives us power to create custom interactions for our users and provides lightning fast client side routing for our users.

As far as static blogging software goes Vuelog is not the most developed nor does it have the largest community. However it does utilize the power of Vue.js to render blog posts on the client. The codebase is small enough to be able to understand nearly in its entirety. If you are comfortable with Vue.js Vuelog is definitely worth exploring further for your blogging and static site needs.

support custom home page

Currently the only choice is between default home view (Vuelog introduction) and the blog posts view.

This requires another relevant feature: allow to hide page from archive view.

Use with Lunr

Hi Leo,
Is there any chance of you integrating Lunr or ElasticLunr and Grunt as part of the basic package to enable some kind of search feature on the markdown files directories out of the box?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.