Categories
Online Marketing

lb: Blog System in Less Than 100 Lines of Shell Script!

So especially now that I’m starting my dissertation and I’m going to be like I’m basically going to be a neat like I don’t have to go to classes or anything at a daily basis, so it’d be nice to keep myself on task now.

I am NOT a big fan of a lot of blogging software out there. You know, I don’t want to use WordPress or anything. That’s too bloated. I want to have something that just generates HTML pages, really simply not even a static page generator, just something. That’s very. Like makes sense, I don’t have to you know, write anything and markdown and convert it to HTML and do all the silly stuff. So I ended up writing a little blog system that might be worth checking out if you’re interested, so it’s actually written in less than a hundred lines of shell script.

In fact, I think it’s. If I actually look at it, I think it’s considerably less yeah. It’s just 71 lines, that’s all you need, but it does everything that I need and it gives you some nice different interfaces that might be interesting. Let me show you how it looks on my website so right now. I just have it here so they’re different in are different ways of looking at it, so the pH I’ve linked here is a rolling blog page, and this is originally the only thing I wanted, but it has other stuff that, in addition to this – and that is When I put up in a blog entry, it appears here as a you know, a new entry, of course they’re in chronological order, auto generates the date, gives me a title.

One of the nice things at is it generates links so it generates. The first link is like a link to the header, so if I click on this link, it actually takes me directly to the header and of course you can copy this, I’m not even on my website, I’m on the offline one, but it doesn’t matter, but you Can just copy the HTML that it generates in the standalone link if you want to link directly to that entry, so you can just copy this share it with some Linnell and it goes directly to that entry.

As you know, you probably have seen in other sites, but it’s nice having this automatic um. Additionally, in addition to that, it generates a link to a standalone page. So if you just want to view one alone, you can do that just as well. Now I don’t have the kind of thing where, like it cuts off after a point, I might integrate that later. But really my goal like what I want to have like what I like in blogs is when they’re just everything is just on one page and if you only use plain text, it doesn’t really get that big.

So my idea is like write, my blog page here. This isn’t part of the system necessarily, but mine is 2008. The HTML and my idea is after 2008 I’ll start using 2009 or something like that. That way, the pages don’t get too big, but my idea is like on this page. Everything should be there, but you know if you don’t like it, you can probably change the the script around, but so it generates these links that generates standalone pages and stuff, like that it also when you finalize a link, it automatically R adds it to the RSS Feed, so you can check my RSS feed and you’ll see that all the syntax is actually here as well.

Actually, let me just open up my RSS feed manually, so you’ll see that it generates it. Of course it takes that AIT’s HTML takes all the metadata. It needs and puts it into some kind of you know, gives it a unique ID the date it’s stuff like that, then it needs to be read properly by RSS readers, so all of that is like totally automatic. Let me show you how you actually use oh and the other interface I should say, which is something I’ve been playing around.

I don’t know if you checked out my website recently, but I’ve been playing around with this for other stuff. Like you know, Apache has this. You know we’re all familiar with it. Probably, but people don’t use them much, often like where a putt Apache can just generate the directory contents for a folder. So you can see the content of the contents of my proto-indo-european folder here. But the same thing is true: if the blog posts, so you can go to slash blog and these are actually out of order because I’ve been playing around with them, but if you don’t mess around with them since you’re, not figure out the cyst like, I am It’ll automatically add them and you can list them in chronological order or something like that, if you don’t know how to do this, for you know, Apache just look up how to make an Apache.

What is it like indexes or something like that? But anyway, so how does this blog system actually work? What’s the actual interface, so I’m going to go to my website directory and you’ll, see here the script here lb. That’s the name of my blog system is symlink. T’, so if you just run it by default, it gives you some directions, but I’ll talk about those in a second to add a new entry. It really just has three commands new finalize and delete so new.

It asks for a title. Let’s say you know, this is a blog post title and you go into it opens up, I think, and it might be vim. I might want to change it to your default editor, but it opens up. You know a page where you can actually add the content. So this is the content and of course this is you know it’s just an HTML, so you can do whatever you want here, save that and now, when you’re done, modifying the file, it’s actually stored, as it says here, it’s stored in a slash blog, slash, dot Drafts now, if you want to get rid of that draft, all you have to do is just RM it.

That’s all you have to do, but if you want to finalize it, what you should do is run lb finalize and that will give you a list of all your drafts. Currently I just have one so I’m going to pick that one and it’s now finalized. Now what that means is, it adds it first off to the HTML like rolling blog page. So here it is here. This is the content artists that are generally a standalone page. This is the content average of that nice and simple.

As the author name below and stuff on the standalone page – and it also it’s not going to work on my URL link, but I can because I haven’t updated my website. But if I go to my RSS feed offline you’ll see that here it’s all been added to the RSS feed, read the RSS feed or whatever. So all of that is automatic. Now, let’s say this is just in an example. I don’t actually want to push this to my website, so what you can do is just run lb delete to delete an old post and that generates a list of all the posts that you have, and I want to get rid of.

I should probably have this ordered chronologically. That would be a little easier, but yeah I’ll do that in a second. So all you have to do is select the one you want to get rid of say yes and then it actually it deletes the file. The standalone file – and it also deletes all that information from the RSS feed and the rolling blog page. So if I go back to this this, that entry is now going to be gone.

Okay, so that’s pretty much all the system. Does it again? It’s really simple! You just create blog posts and it’ll, convert it to RSS syntax and whatever else you need, if you want to delete a post, it will do that automatically. So one thing the one thing it doesn’t do since it’s not like a database or it doesn’t generate pages on the fly is: if you want to modify a post, you would basically have to modify the standalone page and the you know the the rolling blog list And the RSS feeds separately – that’s not the intended interface just because, and it would probably be a little more difficult to add something like that.

Just because there can be there can be a lot that varies between files. So I mean I I’m the kind of person I don’t like revise things like, I don’t believe in correcting spelling checks, there’s spelling mistakes or whatever. So I don’t care, but you know whatever, so it might not be for you if you’re the kind of person who is like that. That’s what I’m trying to say um and the last thing is what is the last thing just two seconds ago in my head, I was like.

Oh, I got ta say this one more thing. What what is the the last thing? I have to say. I don’t know, maybe that is it I’m going to forget, I’m going to turn off the camera and come back in a second. When I remember okay, I remember the last thing is the the other things it’s sort of important to remember is like when it’s generating these entries in the web, like the rolling blog page. All of this is like I mean it actually creates.

If you look at the source of it, it is a div of the class entry or something like this, so all the user interface or not user interface. All the decoration. I have like the fact that this is a slightly darker gray and the the sidebar here. All of that is just CSS, so for a lot of this stuff, if you want like a your blog to look totally different from mine, you can change it all the stuff like how Andrew individual entries look or how you know if you want them all as Individual squares on a page or something something totally unreadable, all of that’s a possibility.

All the thing does and well I should say you can go into the actual script and change any number of variables of the things you know that are at stake. So, of course you know here you can set your individual website, which is obviously not the same as mine you’re, going to want to change that or the stuff up here. You can also change, I think, yeah things like the header or the footer to the the individual page, the date that is displayed on the website.

This stuff is lower down because it has to be called lower down, but yeah, so you can play around with it again. It is less than 75 lines, so it doesn’t have all the functionality and that again it can’t, like you know, like change the content. I’ve already published blogs unless you want to do it manually, but yeah I’ve really enjoyed like this is pretty much all I need for a blog, so it’s probably the kind of stuff I’m going to be using so anyway, but that’s about it and I’ll see you Guys next time hope you learn something


Don't have time to do the blogging thing?

Maybe Copywriting services are for you.

 

 

Categories
Online Marketing

Getting Started With Edublogs

You sign up for a blog with edgy blogs and then help you learn how you can access your blog and your dashboard. We’ll take a look at how to write posts and pages and how to approve your comments and we’ll also look at how you can change the theme of your blog and change your settings.

Finally, I’ll, let you know where you can find all the extra help you’ll need to keep going with blogging, let’s get started so you’re ready to start blogging. The first thing you’ll need to do, of course, is get yourself a blog. All you need to do is go to our Joe Bloggs org, unless, of course, your school or district has their own campus press subscription on the edge of blogs. Homepage you’ll see a box that says get a free blog.

You just need to enter a username and password, and then click on sign up on the next page, you’ll be prompted to add a little bit more information like your email address. You’ll also be asked to choose your blog URL. It’s important to remember that you can’t change your blog URL, so think carefully about choosing something that will last. You might not want to call your blog grade 3 2018, because in 2019 you might be teaching grade 5 and you might have to start a new blog which can be frustrating once you’ve signed up for a blog you’ll get an email that reminds you off.

Your blog URL and your login details you’ll be able to click on a link in your email to get to your blog dashboard. The dashboard is the backend of your blog. This is a part of your blog that only you can access unless you had other people, and this is where you can change the look and feel of your blog, as well as publish new content like posts and pages and see if anyone’s commented on your blog And approved a comment approve your comments or reply to them.

So if we want to have a look at the front end of our blog, you just type the URL into your address bar my URL, for my new blog here is mrs. Kay MERIS edgy blogs org. I can see that my brand new blog has a simple post and a few things on the sidebar here, but that’s all just there by default and I’ll be able to change all of that to do that. I’ll have to go back to the dashboard. So how do I get into the dashboard? There are a couple of ways: you’ll see, there’s an edgy blogs toolbar at the top here.

If I’m not logged in you’ll see the words login and if you are logged in like I am here, there’s a few shortcuts to get to your dashboard. You can click on you and go to a new post, for example, or if you hover over your name. You’ll be able to go straight into your dashboard there and if you want to know the address to get to your dashboard, you can just do a slash at the end of your blog URL and then WP for WordPress.

And then you can write in admin all login works as well when I press ENTER. This will take me straight to my dashboard. Some people like to have both their dashboard and their blog URL bookmarked, because when you’re working on your blog, you sometimes want to switch between your dashboard and your blog to see what it looks like when you publish something. Let’s take a look around your dashboard when you land on your dashboard.

The first thing you’ll see is your reader. This is where you can read and comment on other blocks. By default. You should see all the posts we’ve written recently on the edge’ blocker, the edgy blogger comm is just edublogs blog about blogging. You can also add other blogs that you’re interested in to your reader and, if you end up having student blogs, you’ll be able to see them there as well. On the left hand, side you’ll be able to see lots of options if you’re totally new to blogging.

You won’t need to use all these options to start with, but there are a couple that you’ll use a lot. One of these is posts. When you have hover over posts, you’ll see the options, all posts add new and categories and tags. If we click on all posts, we’ll be able to see that there’s one post here and it’s called hello world, that’s the one we looked at that was on our blog by default. When you hover over the title, hello world, you’ll, see that you can edit it or you can trash it.

If you don’t want it or you can have a look at it as well. Let’s click on edit and then we can make this post our own at the top is where you write the title of your post. You can leave it as hello world or you can make it something else. Now in this box you can highlight all the text and then just press Delete. Now I can write my own text. Welcome to my blog, it’s just like typing in a word processor, like Microsoft Word, although it’s important to remember not to actually type your process.

In word, and then copy and paste them into your blog that can cause problems with bad codes, so just always type your post directly into your blog. One thing you might want to do is sometimes link to other websites. If I write check about petty blogger, I might want to link to the edge of lager for other people to visit. All I need to do is get the URL of the site. I want to link to I’m just going to copy that.

Then you highlight the words you want to be linked: click on the link icon here and just type or paste in the URL and click on the arrow. Then, when people are reading, your post they’ll be able to click on those words to get to the site. Another thing you’ll probably want to do is add images to your blog posts. This is really simple. You just click on, add media. Then you can upload your files, just select them from wherever they’re located on your computer.

I’r going to insert this picture on the right. You’ll see, you can add a few options like a title and a caption alt text is a really good idea to add. This is just a description of what the image looks like, which can help your visually impaired readers. You can also change your alignment and size. Then, when you’re ready click on insert into post – and you should see it appear there now – there’s lots of options up the top here.

You can highlight your text and change your size. It will be paragraph size for your regular writing that you can also have headings you can highlight and then make your text bold or italics those bullet points and numbered lists, and so on. When you hover over all these icons, it tells you what it is, and the last icon here is the toolbar toggle, which will show you some other options that you might like to use like changing your text color.

When your post is ready, you can click on preview changes at the top here and it will open your post in a new tab. So you can see what it looks like on your blog and when you’re happy to publish it, you can just click on update. If this was a brand new post, this button would just say, publish you might want to add some pages to your blog as well, with some more static information like your class timetable or your commenting guidelines to do this you’ll find pages on the left-hand side here, When you hover over the word pages, you’ll see all pages and had new when you click on add new you’ll, see that adding a page is just like writing a post up the top.

You enter your title and then in the box here you just write whatever you like. You can add links and images just the same as if you’re writing a post when you’re ready, you can click on preview to see what your page is looking like and when you’re happy with the way it looks. All you need to do is hit publish. Another thing you might want to know about is comments so over on the left hand, side you’ll, see the comments option and you can look at all your comments by default.

There should be one comment here which was automatically written for your hello world post and it’s already been approved, but if you’re not happy with it, you can uh approve it or you can reply to it. If I click on reply, I’ll see a box here where I can write back and say, thank you for the comment. Then I just press reply and your other options to edit it. So if it was students work and you wanted to edit it before it was published, you can do that if it’s spam, just click on spam or put it in the bin.

If you don’t want it to be published so you’ll see next to pending there’s a zero. That means I’ve got no comments waiting for me to approve, but once you start getting comments on your blog you’ll see a little icon next to comments. That will tell you the number of comments you need to check and up here next to pending, you’ll see the number as well and if you click on the word pending you’ll be able to go straight to all the comments that you need to moderate so that You can go through them and approve them or not.

You may have noticed that when you first set up a blog, it looks pretty bland to begin with, but you can change the look and feel of your blog and really personalize it to make it your own and the way you do this is through themes. Let’s go back into our dashboard and if we click on appearance and themes be able to see that there are hundreds of themes available to really make our blog alone there’s options up the top for different categories of themes.

If I click on popular, I can see what other people have liked using for their blogs. You’ll see that some of the themes like this one here color has a header image, so you might want to see them like that. If you want to put a picture of your class or school in there, if there’s a theme that you think might work for you, you can hover over it and click on live preview. When you do that, you’ll be able to see what your blog would look like with this with this theme without actually committing to it.

So when it loads here I’ll be able to see that my blog title is up here, Kathleen Morris and here’s the post I’ve just written my sidebar now on the right-hand side, because that’s the way this theme works. If I want to, I can play around with the options here, like the color scheme, the background image and so on, and if I’m happy with it, I just click on save and activate. Now, if I go back to my blog and refresh that will click on the title of my blog I’ll be able to see what it looks like if I’m not happy with it.

Of course, I can go and keep playing around with themes, but otherwise it’s fun to have a new look to your blog. The final thing we’ll take a look at for now is some settings. Let’s click on settings over on the left-hand side here and we’ll. First go into our general settings here you can change the site title now. You might remember that I said you can’t change the URL of your blog, but you can change the site title so, instead of calling my blog Kathleen Morris, I might want to call it mrs.

Morris’s us. The tagline is what shows up under your site title just here by default, it will say just another edgy blog site, so you might want to change its up to something that suits you. I might write here a a great wall class from Australia. You can change your email address your language and your time zone if you want to and your date as well when you’re happy with that click on Save Changes.

If you look in your reading, settings you’ll be able to see that this is where you can change your site. Visibility. If you want to make your blog private or have it so only logged in edgy blogs, users can access your site or you can have your blog totally password protected. If you click on discussions, this is where you can change your commenting settings. One of the options you might want to take a look at is you might want to tick that all your comments have to be manually approved, and you can also change your settings of whether you get an email.

When you get new comments, it can feel really overwhelming when you first get started with blogging and you’re just working out how to navigate your dashboard, it might feel like there are so many options and you can’t keep track of what all these tools are. Try not to worry because, as long as you know how to do a few basics like adding posts and checking your comments, you’ll pick up the other things over time.

You don’t need to know everything at once. Also, remember if you go to help add your blog’s org. This is where you can find all our user guides. You can type in the search bar to find what you’re after or you can browse through some of the guides, and if you get stuck, and you can’t figure it out, you can always email the support team. Just email support at edublogs, org


Don't have time to do the blogging thing?

Maybe Copywriting services are for you.