Coder Social home page Coder Social logo

lb's People

Contributors

jneidel avatar joestandring avatar lukesmithxyz avatar niklasbuehler avatar rickyjon avatar skuzzymiglet avatar x-t 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  avatar  avatar  avatar  avatar

lb's Issues

Duplicate checking

Will lb implement duplicate title checking? Right now if you create a second post with the same title it just appends to the already existing blog post.

If a blog post page contains numerical digit(s), it can throw off revising a blog entry

One of my pages happens to be titled "Season 3 nostalgia," and I wanted to revise post 3, "Scary Dairy." This is what happens:

pic-select-202007-1554-02

Basically, nothing shows up in the text editor because lb has concatenated the titles of "Season 3 Nostalgia" with "Scary Dairy." This happens because of the command:

chosen="$(ls -rc "$1" -I '*[^".html"]' -I "index.html" | nl | grep -w " $number" | awk '{print $2}')"

where grep -w "$number" ends up selecting two pages at once:

pic-select-202007-1551-54

However, modifying the grep command to include a preceding space before $number: grep -w " $number" fixes the issue.

not enough shaky soy css magic

please add option to soyify my entire blog post.

i have an army of pacifist munchkins at my disposal. they will give you tasty gumdrops should you comply. If you do not comply there will be no negative consequences but also you will not receive gumdrops. make your next move wisely

Letting lb do the job with: ./lb l

I was thinking about committing a little modification to lb that allows the user to list all published entries by running ./lb l.
This would be accomplished by creating a new list() function (that can then be called by listandReturn() for all other purposes), but I'm not sure if it is a good overall addition... Truth is, it might just result in bloating lb since the output would practically be the same as running ls on the blog directory, but with the formatting listandReturn() currently does.
The pretty thing about it would be that the end user could just interface with its blog by using lb, and only lb.
With that in mind, I opened an issue for us to debate.

When inserting <div> </div> into blog entry, it mucks up the rolling view page

Say for example, if you wanted to format an embed YouTube video, or want to put a special section like so:

<div class="video-container">
   ...
</div>

What happens is that after you publish it, in rolling view, the entry is duplicated outside the blog post bounds:

pic-select-202007-1812-20

with the page source looking like this:

<div class='entry'>
aaa
<div class="video-container">
  bbb
</div>

ccc
</div>

aaa
<div class="video-container">
  bbb
</div>

ccc
</div>

I suspect the lb script relies on using </div> (as a line by itself) to delineate the entries between blog posts, but when you manually put in </div> in the entry, the script is confused. This does not happen if <div> and </div> are on the same line. One workaround is using something like

<section id="blablabla"> 
    insert stuff here
</section>

where this issue is avoided entirely.

No blog index?

There doesn't appear to be an example blogindex.html file in this repo. Is this accidental or purposeful?

Revise duplicates articles

lb r duplicates the article in the RSS-feed. (this is hard to fix, because you have to regex match that part of the XML)

"Recent Blog Posts" feature missing?

In the html for lukesmith.xyz, there is a <!--BLOG--> tag, and under it are your 5 recent blog posts. Is lb supposed to put blog titles there. or is that managed by a different process? If it is managed by lb, then putting in my html file and creating a new blogpost does not do the trick.

./lb: line 36: [directory shit]/test.html: Permission denied

Okay, so I'm probably going to look like a total brainlet (which I am,) but I really can't figure this out. I've tried messing with the script, keeping it as default, re-cloning, a lot of the logical stuff. The 2018.html file has the correct comment for LB to theoretically work, but I constantly get that error when trying to run ./lb new. Please go light on how stupid I am.

Hope that's enough info.

User m4 for HTML

I've been investigating m4 for one of my own websites and thought you might be interested. You can change lines like this:

printf "<html>\\n<head>\\n<title>%s</title>\\n<link rel='stylesheet' type='text/css' href='%s'>\\n<meta charset='utf-8'/>\\n</head>\\n<body>\\n<h1>%s</h1>\\n<small>[<a href='%s#%s'>link</a>&mdash;<a href='%s'>standalone</a>]</small>\\n%s\\n<footer>by <strong><a href='%s'>%s</a></strong></footer>\\n</body>\\n\\n</html>" "$realname" "$css" "$realname" "../$blogfile" "$base" "$basefile" "$(cat "$webdir/blog/.drafts/$basefile")" "$website" "$name" > "$webdir/blog/$basefile"

Into something like this (untested):

m4 -DREALNAME=$realname -DCSS=$css -DBLOGFILE="../$blogfile" -DBASE=$base -DBASEFILE=$basefile -DCONTENT="$(cat "$webdir/blog/.drafts/$basefile")" -DWEBSITE=$website -DNAME=$name <<HTML > "$webdir/blog/$basefile"
<html>
  <head>
    <title>REALNAME</title>
    <link rel='stylesheet' type='text/css' href='CSS'>
    <meta charset='utf-8'/>
  </head>
  <body>
    <h1>REALNAME</h1>
    <small>[<a href='BLOGFILE#BASE'>link</a>&mdash;<a href='BASEFILE'>standalone</a>]</small>
    CONTENT
    <footer>by <strong><a href='WEBSITE'>NAME</a></strong></footer>
  </body>
</html>
HTML

Much more readable IMO, and m4 comes standard pretty much everywhere.

You could also store the HTML template in a separate file to keep your code cleaner.

Locales break the RSS feed.

I have my LANG always set to en_US, but some of my LCs are usually de_DE, so date +%a and date +%b output German abbreviations, which completely broke my RSS feed.

In fact, RSS uses RFC 2822, which can be accomplished by just using date -R, otherwise you could always set LC_TIME=C.

Needed: Easy removal of fancy unicode characters from strings for url in elegant way

Opening as a note to myself or an invitation to others.

Right now, urls are created from literal titles as follows:

url="$(echo "$title" | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')"

I.e. take the title, delete punctuation, use all lowercase and turn spaces into -. Simple. Works 98% of the time.

But there are some characters that will prevent proper RSS validation, such as emojis.

Even more, I'd like to replace accented characters with non-accented characters to ensure that urls are universally typeable.

Titles are broken

I named a post "Test" and when I published the post, the title became "Test test test Test test"

I tried again, naming the post "Yee yee cowboys" and the title is just blank.

I thought the issue might be that the text in the first post was "test" and in the second post it was "yee", so lb might not be handling duplicate text, but that is not the case. I tried a post called "l" with a text of "b" and the title became "Anime Should Be Illegal K-Pop Ought to be Illegal KPop Should be Illegal" (which are titles of previous posts I have made; don't ask)

The only modification I've made to the software is adding a line to the head in each published file that is a link to a google font, but the issue persists without said line. I tried again with a vanilla lb script, and named a post "yeet" with a text of "yote" but the title comes out as "yeet yeet".

It seems completely random, to be honest.

Titles with `/` fail to create standalone entries

Noting this here because I can't deal with it right now.

I noticed that while titles with / work with the RSS feed, rolling blog, etc., they do not properly output to the blog/ folder as standalone entries.

It's a problem with sed, the / should be escaped. I'll fix this elegantly when I get the chance, but if anyone else wants to do a PR first, you're welcome to.

./lb delete removes similarly named posts from blog index

I had three test pages, test-post.html, test-post-2.html, and test-post-3.html. When I run./lb delete it removes all three pages from the blog index. I checked this again by making 3 new pages, yeet.html, yeet-2.html, and test.html. When I delete yeet.html using ./lb delete it also removes yeet-2.html from the index, but test.html remains. The pages aren't being deleted, they're just no longer shown on the rolling blog page.

suggestion: don't modify the date when edit/revise

hi
just a quick suggestion,
it would be nice if there could be a way for lb not to modify the date once it have been set at creation time.

while testing out lb, changing some stuffs.. the layout and such, at some point i had to modify all the entries i previously made last month in order to make sure all my articles do pick up the changes i made, and as a result all my entries are now displaying the date at time of editing instead of creation date, giving the impression the article is new while it's not. so i'm reporting this as suggestion for enhancement.

anyway, thanks for lb, it's cool.

[Question] Blog On Index.html Not Showing & 404 Blogposts

I'm trying to get the blog to show on my main index.html (not blogindex.html), they show up on blogindex.html.

I put the <! -- LB -- > where it should post the blogposts.

I think it is related to where lb is, I have /var/www/mysite/ as the root dir, then I cloned lb, so it made an lb folder in /mysite/.

I was having issues with my stylesheet not applying properly to the blogindex.html, so I moved blogindex.html out of lb and put it right in the root dir, and I changed blogindex dir in the lb script to the root folder.

Now, I don't know if the dir placement is the issue, because blogindex.html is in the root dir, as is index.html, however the blog only posts to blogindex, but not index, idky.

The other issue I am having, is for some reason when I make a new blogpost, and it posts onto blogindex, if I go to click the blogpost on the site, it brings me to a 404 page.
If it can post to blogindex, I fail to see why it would be having an issue.

I've never done this before, so maybe I should have my directories different. Not sure. I was considering just moving all files out of lb/, but that'd make my site root dir a mess.

Would really appreciate some support. Thanks.

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.