GithubHelp home page GithubHelp logo

zupzup / blog-generator Goto Github PK

View Code? Open in Web Editor NEW
89.0 6.0 20.0 228 KB

static blog generator for my blog at https://zupzup.org/

License: Apache License 2.0

Go 99.82% Shell 0.18%
static-site-generator blog-generator markdown go golang tags rss sitemap blog

blog-generator's People

Contributors

hpgrahsl avatar lesterzone avatar zupzup 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

blog-generator's Issues

canonical URLs might be broken

Hi, I visited your blog article (https://zupzup.org/epoll-with-rust/) which I found so much interesting but I noticed that canonical URL is wrong.

Setting canonical of all the blog articles to the top page is confusing for crawlers.

What is index.xml?

I'm enjoying the generator but just noticed index.xml is very large. I'm making a backup of some my club's newsletters and storing them into one html/md file per blog post. They vary from 1 or 2 MB to 20MB per file. The images are base64 encoded within the file. When I look at the built www folder, my index.xml file is about the same size as all my posts, which is basically doubling the www folder size. Is this normal??

not enough arguments in call to

Hi @zupzup ,

thanks for the amazing code, I'm really looking forward to test it and use it :D

I was perform the step

go get github.com/zupzup/blog-generator

And I receive the message

../go/src/github.com/zupzup/blog-generator/generator/generator.go:243:40: not enough arguments in call to "github.com/alecthomas/chroma/formatters/html".WithClasses
   have ()
   want (bool)
../go/src/github.com/zupzup/blog-generator/generator/post.go:168:41: not enough arguments in call to "github.com/alecthomas/chroma/formatters/html".WithClasses
   have ()
   want (bool)

โฏ go version
go version go1.12.13 linux/amd64

If you could guide me or give me some advice I will appreciated.

All the best

Building error

Just trying this out. Looks very nice. I'm on windows7. Executed the "go get" to get my exe. Copied the "static" folder over to same folder as the blog-generator.exe. Used the same bloggen.yml file as yours except used my forked repo for the content. Then ran the exe and got this error-

Fetching complete.
Generating Site...
        Generating Post: Syntax-Highlighting from a Markdown source in Go using Chroma...
        Generating Post: Scrolling Endpoint with Kotlin and Spring Boot...
        Generating Post: Elasticsearch to Prometheus Exporter in Go...
        Generating Post: Basic AST Traversal in Go...
        Generating Post: Basic AST Manipulation in Go...
        Generating Post: Ethereum Prepaid Transactions with Go...
        Generating Post: Interactions between Smart Contracts with Solidity...
        Generating Post: The Benefits of Uninterrupted, Focused Work...
        Generating Post: Ethereum Light-Client with React Native...
        Generating Post: HTTP File Upload and Download with Go...
2018/10/10 21:08:53 error executing template www\kotlin-scrolling-endpoint\index.html: template: tem
plate.html:212:14: executing "template.html" at <.HighlightCSS>: can't evaluate field HighlightCSS i
n type generator.IndexData

When I look at www\kotlin-scrolling-endpoint\index.html I see no .HighlightCSS in the file. The file actually ends with some styling commands. I forked your content site just to see how it works. Can you see what I'm doing wrong?

I'm also not sure how this generator works. When I enter the blog url into the config file, how is that related to the content, meaning how does the content get uploaded to that blog url? Automatically or manually?

Update - well delete all the above. I had an older exe from months ago, so I updated it and now the site builds fine. So I just upload to anywhere I want then, yes?

Also, just tried setting the blog url to "http://localhost/zupzup/www" and it doesn't work. All links seem to be based on localhost root, like this - "http://localhost/go-markdown-syntax-highlight-chroma/". Is this working correctly?

File-Based configuration

It should be possible to configure the tool via bloggen.yml file, which holds all the settings which are currently implemented as constants in generator/generator.go

The Source repository, tmp-folder and output folder should also be configurable using this config.

Sitemap and RSS incomplete link

Hi,

I checked my sitemap and rss and their links are missing the first letter of each post.

maybe it has something to do with the update of chroma?

here an example:

<rss version="2.0">
<channel>
<title>AdminSecurity Blog by Alejandro Betancor</title>
<link>https://adminsecurity.guru</link>
<language>en-us</language>
<description>
A blog about Go, JavaScript, Open Source and Programming in General
</description>
<lastBuildDate>20 Dec 2019 17:32 +0100</lastBuildDate>
<atom:link href="https://adminsecurity.guru/index.xml" rel="self" type="application/rss+xml"/>
<item>
<title>Migrating Traefik from v1.7.x to v2.1</title>
<link>
https://adminsecurity.guru/raefik-migrating-v1-to-v2/
</link>
<guid>
https://adminsecurity.guru/raefik-migrating-v1-to-v2/
</guid>
<pubDate>20 Dec 2019 00:00 +0000</pubDate>
<description>
<p>My expirience migrating from one version to another</p>
</description>
</item>
<item>
<title>Hello Go!</title>
<link>https://adminsecurity.guru/ello-go/</link>
<guid>https://adminsecurity.guru/ello-go/</guid>
<pubDate>20 Dec 2019 00:00 +0000</pubDate>
<description><p>My first post</p> </description>
</item>
</channel>
</rss>

thanks

Source Question

Just came back to this generator and it is very nice. Is it possible to use the current folder that the build exe is in for the source markdown files or even a subfolder which I can name anything I want ? I want to store my source md files locally is the reason.

Is there a simple change I could make so that the meta data is in the top of the post instead of a separate file?

Error on build with own template

I'm trying to use my own template with the same tags as the original one in the repo, but I'm getting errors like this -

Generating Site...
        Generating Post: Syntax-Highlighting from a Markdown source in Go using Chroma...
        Generating Post: Log Deletion on ELK stack using Go...
        Generating Post: Scrolling Endpoint with Kotlin and Spring Boot...
        Generating Post: Creating an iCal feed with Go...
        Generating Post: Ethereum Light-Client with React Native...
        Generating Post: Basic AST Manipulation in Go...
        Generating Post: Ethereum Prepaid Transactions with Go...
2020/02/02 17:35:11 error executing template www\go-markdown-syntax-highlight-chroma\index.html: html/template:template.html: "<" in unquoted attr: "<br"

Do you know why this may be occurring? I do have a few <br> in my template but that's proper html.

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.