kristapsdz / sblg Goto Github PK
View Code? Open in Web Editor NEWstatic blog utility
Home Page: https://kristaps.bsd.lv/sblg
License: ISC License
static blog utility
Home Page: https://kristaps.bsd.lv/sblg
License: ISC License
Trying to create html article pages, then amalgamating them into a main blog page. If the article html files are used in the blog amalgamation page, data after the tag gets inlined.
$ cat article-test.html
<html>
<head>
<title>My Blog</title>
</head>
<body bgcolor="#ffffff">
<article data-sblg-article="1" data-sblg-tags="test short">
<header>
<h1>Article Name</h1>
<address>Author Name</address>
<time datetime="2013-06-29">29 June, 2013</time>
</header>
<aside>
This is used as the feed <b>content</b>.
</aside>
<p>Some article text.</p>
</article>
<div data-sblg-permlink="1"><a href="article-test.xml">permanent link</a></div>
Extra stuff
</body>
</html>
$ cat index.html
<html>
<head>
<title>My Blog</title>
</head>
<body bgcolor="#ffffff">
<article data-sblg-article="1" data-sblg-tags="test short">
<header>
<h1>Article Name</h1>
<address>Author Name</address>
<time datetime="2013-06-29">29 June, 2013</time>
</header>
<aside>
This is used as the feed <b>content</b>.
</aside>
<p>Some article text.</p>
</article>
permanent link</a></div>
Extra stuff
</body>
</html>
<div data-sblg-permlink="1"><a href="article-test.html">permanent link</a></div>
</body>
</html>
If I create an article with a %F
-style datetime
, sblg
interprets the date as midnight UTC, and will convert that time to the local timezone before printing timestamps. For people west of UTC this will produce "incorrect" dates.
% cat test.html
<!DOCTYPE html>
<html>
<body>
<article data-sblg-article="1">
<time datetime="2018-06-07"></time>
<p>test</p>
</article>
</body>
</html>
% sblg -o- test.html
<!DOCTYPE html>
<html>
<body>
<nav data-sblg-nav="1">
<ul>
<li>2018-06-06: <a href="test.html">Untitled article</a></li>
</ul></nav>
</body>
</html>
After the weirdness of #8 I tested if this was a musl thing, and at least on Linux it's not libc-dependent.
Compilation (make
) failed on my system (Debian Linux i386), throwing the error below. I could not find a definition of SBLTAG in the codebase.
util.c: In function ‘sblg_destroy’:
util.c:1034:18: error: ‘SBLTAG_NONE’ undeclared (first use in this function)
for (i = 0; i < SBLTAG_NONE; i++) {
^
I talked to @michaeldexter about sblg recently and he said you might be open to markdown as a format for articles. I have an existing site using octopress but it is too complex and I want something simpler. It looks like sblg is exactly what I am looking for but I prefer markdown and have hundreds of posts that are currently in markdown. I am happy to change things around but still enjoy writing in markdown if possible. Is that something you would consider?
Hey,
I'm enjoying sblg but facing a simple issue regarding code that need to embed some ${VARIABLE}
, they are interpreted by sblg
itself and I could not find how to escape them so that sblg
does not mangle them.
Example of input:
<article data-sblg-article="1">
Check my variable expansion ${PATH%.xml}.
</article>
The generated content will have a placeholder instead:
$ sblg -t template.xml -c test.xml && grep Check test.html
Check my variable expansion .
Is there a way to escape those strings?
Can you tell me how to use it with markdown ? i can't get it working.
I have online markdown interpreter but when i fill html code inside article.xml installwww do not work. Thank you.
As far as I can tell, there is no current way to generate articles with the URL style of:
http://www.example.com/blog/article-name/index.html
Currently, sblg generates:
http://www.example.com/blog/article-name.html
I have an existing blog that I am planning to convert to sblg but all of the articles are in the article-name/index.html format. I would rather keep it that way even though it is possible to redirect to article-name.html. Have you considered adding support for this way of generating articles?
https://github.com/kristapsdz/sblg/blame/master/README.md#L11
article010.html should be article10.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.