Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish technical blog archives #43

Merged
merged 1 commit into from
Mar 25, 2019
Merged

Publish technical blog archives #43

merged 1 commit into from
Mar 25, 2019

Conversation

kgodey
Copy link
Member

@kgodey kgodey commented Mar 20, 2019

Description

Adds a blog to Lektor containing old CC technical blog posts.

Old posts are currently located here and not deployed anywhere AFAIK: https://github.com/creativecommons/labs/tree/gh-pages/_posts

Remaining work

  • Import remaining blog posts from the labs repo
    • Convert HTML to Markdown where appropriate
    • Include images associated with posts, (images are in the top level <year> directories).
    • Include categories (will require a change to the blog post model)
    • Fix URLs to other posts (currently points to techblog.creativecommons.org which does not exist).
  • Verify that pagination works and style it appropriately.
  • Show categories in UI
  • Link to blog from navigation (not sure which section is the best place yet)

Future work
This work will be done in future pull requests.

  • Create author pages that show all of one author's posts.
  • Create category pages that show posts associated with a category.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the master branch of the repository.
  • My commit messages follow best practices.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

@kgodey kgodey changed the title Initial commit for blog setup and single example post. Publish technical blog archives Mar 20, 2019
@kgodey kgodey added the help wanted Open to participation from the community label Mar 20, 2019
@makkoncept
Copy link
Member

Hi @kgodey, Can I work on this.
I can start working on the first task (Import remaining blog posts from the labs repo).

@kgodey
Copy link
Member Author

kgodey commented Mar 20, 2019

Sure, go ahead!

@makkoncept
Copy link
Member

@kgodey , i have made a python scipt that does the first subtask(Convert HTML to Markdown where appropriate).

For the second subtask, I want to point out that:

I have found most of the images in top level img directory but there might be few exceptions. So I think this directory can be used instead of year directories in the script.
What do you think?

Also just to clarify, URLs like these http://techblog.creativecommons.org/2007/05/13/more-xmp-toolkit-plugs should be changed to https://creativecommons.github.io/tech-blog-archives/more-xmp-toolkit-plugs?

@kgodey
Copy link
Member Author

kgodey commented Mar 22, 2019

@makkoncept
If the images are not present, just have an empty image tag (to indicate that there once was an image. You can get them from wherever in the repo makes sense, I didn't realize there was an img/ folder too. You should probably check in both places before assuming it doesn't exist.

Images should be moved into the same directory as the contents.lr file and set up as Lektor attachments (see docs here). See the contributing-code page for an example, it links to two images that are in the same folder.

@makkoncept
Copy link
Member

@kgodey, will the default syntax of markdown for the image( ![img](src) ) not work? The script is able to parse the img tag, and convert it to this syntax.

Also just to clarify, URLs like these http://techblog.creativecommons.org/2007/05/13/more-xmp-toolkit-plugs should be changed to https://creativecommons.github.io/tech-blog-archives/more-xmp-toolkit-plugs?

@kgodey
Copy link
Member Author

kgodey commented Mar 22, 2019

@makkoncept I'm not sure which folder the images are served from, you can try it and see if it works. I think it's better to do it in a way that's idiomatic in Lektor.

@makkoncept
Copy link
Member

@kgodey Can you please tell me how to include categories?
Do we have to do something like this?

title: wiki.creativecommons.org skin available
---
categories: mediawiki, releases, software
---
author: nathan
---
body:

@kgodey
Copy link
Member Author

kgodey commented Mar 22, 2019

You have to add a field to the blog post model (see /models/blog-post.ini) For now, just add the categories as a single comma separated field, I'll make a separate ticket for actually implementing category pages (the Lektor guide is here, for reference: https://www.getlektor.com/docs/guides/categories/)

@makkoncept
Copy link
Member

makkoncept commented Mar 22, 2019

@kgodey I have updated the script.
Can you test it locally?
Put it in root with _posts and img directories. It needs bs4 and html2text packages .
The script will make a tech-blog-archives directory.

@kgodey
Copy link
Member Author

kgodey commented Mar 25, 2019

@makkoncept tested and looks good 👍. However the most recent post is on 2012-07-11 and I know there are blog posts up to 2014 in the original repo. Could you make sure all blog posts and images are ported over (maybe count them pre-transformation and post-transformation independently and make sure they match)?

@makkoncept
Copy link
Member

ok @kgodey. Do I make a separate pull request with the all the changes?

@kgodey
Copy link
Member Author

kgodey commented Mar 25, 2019

yes, please do.

@kgodey kgodey marked this pull request as ready for review March 25, 2019 19:06
@kgodey kgodey requested a review from a team March 25, 2019 19:06
@kgodey
Copy link
Member Author

kgodey commented Mar 25, 2019

I'm going to merge this in to prepare for @makkoncept's PR.

@kgodey kgodey merged commit dc17f7d into master Mar 25, 2019
@kgodey kgodey deleted the add_blog branch March 25, 2019 19:07
kgodey added a commit that referenced this pull request Mar 27, 2019
import remaining blog posts from the labs repository. #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open to participation from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants