Entrance Chat Gallery Guilds Search Everyone Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
November 08, 2025 - @206.63 (what is this?)
Activity rating: Four Stars Posts & Arts: 72/1k.beats Unread Topics | Unread Replies | My Stuff | Random Topic | Recent Posts Start New Topic  Submit Art
News: :happy: Open the all windows! Your mind needs storms and air! :happy: Guild Events: Melon Jam 2025

+  MelonLand Forum
|-+  World Wild Web
| |-+  ♺ ∙ Web Crafting Materials
| | |-+  hashbloge - single-page blogging script for static websites


« previous next »
Pages: [1] Print
Author Topic: hashbloge - single-page blogging script for static websites  (Read 173 times)
rolypolyphonic
Casual Poster ⚓︎
*
View Profile WWWArt


The Non-Living World's first and cutest prophet
⛺︎ My Room
StatusCafe: rolypolyphonic
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
Joined 2025!
« on: November 04, 2025 @633.50 »

I figured this would be the best place to share it. Link to hashbloge  :unite:

hashbloge is a JS script that lets you create a single-page blog. What this means is that you have your blog index, which serves as a 'container' and contains all your template/design, and all your blog entries are dynamically injected into it. This means that you only ever need to change your template in one place and don't need to copy-paste any templates across blog entries or use iframes.

It uses hash links (#1, #2, etc.) so that you can permalink to your blog entries and it keeps links short and sweet.

Maybe it will be useful for somebody :cheerR:
Logged

An 88 by 31 button that says breadavota.cafeAn 88 by 31 button that says daydream.attorneyAn 88 by 31 button that says Schizospectral Webring

My projects:

Bread, and all variations of the aforementioned - a hypertext multimedia webcomic series about a sentient Doll and the End of the World
Daydream Attorney - a coagulation of spectres dedicated to turning schizotypy into the world's first viral mind disease
Dan Q
Full Member ⚓︎
***
View Profile WWW


I have no idea what I am doing
⛺︎ My Room
Itch.io: My Games
RSS: RSS

« Reply #1 on: November 04, 2025 @653.33 »

That's cute; I like it.

If anybody's looking for a no-JS solution, I've sometimes used the :target trick to achieve a similar thing with only CSS:


Code
/* Show only the targeted article: */
article {
  display: none;
  
  &:target {
    display: block;
  }
}

/* When we haven't clicked a link, show the index article: */
body:not(:has(:target)) article#index {
  display: block;
}

Here's a playable demo.
Logged


Artifact Swap: I met Dan Q on Melonland!Bananas are better than tomatos!PolyamoryJoined 2025!Lurby
rolypolyphonic
Casual Poster ⚓︎
*
View Profile WWWArt


The Non-Living World's first and cutest prophet
⛺︎ My Room
StatusCafe: rolypolyphonic
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
Joined 2025!
« Reply #2 on: November 05, 2025 @77.94 »

That's cute; I like it.

If anybody's looking for a no-JS solution, I've sometimes used the :target trick to achieve a similar thing with only CSS:


I really like using this method too! In fact, I used to use the same for my blog but I found it unwieldly over time since I'd have to put all entries on a singular webpage.

The reason hashbloge is structured the way it is is precisely so I wouldn't need to change the way my blog posts were linked back when I used this method but now lets me separate blog posts into separate HTML files so that it's easier to organise them over time :unite:
Logged

An 88 by 31 button that says breadavota.cafeAn 88 by 31 button that says daydream.attorneyAn 88 by 31 button that says Schizospectral Webring

My projects:

Bread, and all variations of the aforementioned - a hypertext multimedia webcomic series about a sentient Doll and the End of the World
Daydream Attorney - a coagulation of spectres dedicated to turning schizotypy into the world's first viral mind disease
Dan Q
Full Member ⚓︎
***
View Profile WWW


I have no idea what I am doing
⛺︎ My Room
Itch.io: My Games
RSS: RSS

« Reply #3 on: November 05, 2025 @451.82 »

I really like using this method too! In fact, I used to use the same for my blog but I found it unwieldly over time since I'd have to put all entries on a singular webpage.

Yeah, if I were to use the CSS-only approach for a blog with lots of entries, I'd definitely want to use some kind of static site generator to do the "combine them all into a single file" step.

Just for funsies, before I started work this morning I threw together a tool that does exactly that. Here's the source code, and here's the site it outputs.

All of the posts are stored in separate files, each with metadata to provide its ID, title, and date (the dates are used for sorting, but also it doesn't-include future posts, allowing it to be used for drafts or for scheduled posts). Posts can be written in HTML or Markdown. It works without JS, and it's perfectly usable even without CSS (all the posts appear in a long page, but there are links at the top to jump to each one as well as links that go back to the top at the end of each post).

Sites can be built locally with one command (and then uploaded anywhere, e.g. Neocities) or if it's stored on GitHub then it'll automatically rebuild itself every time a page is changed.

It's ugly as hell, of course, because the CSS I provided above is the entirety of the CSS I included. But it works and might provide a basis for somebody's future experiments!

Thanks for the inspiration!
Logged


Artifact Swap: I met Dan Q on Melonland!Bananas are better than tomatos!PolyamoryJoined 2025!Lurby
Pages: [1] Print 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | ~ Send Feedback ~ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi