Skip to content

BaoXuebin/photography-blog

 
 

Repository files navigation

Personal Photography Blog Generator

The theme was originally made by HTML5 UP Multiverse | HTML5 UP

DEMO: http://i.idinr.com

中文说明

Change Log

2022-6-14

  • Show Image Exif Info

screenshots

Features

  • Fully Responsive
  • HTML5 + CSS3
  • FontAwesome Icons
  • Multi-level Albums Support
  • Basic Breadcrumbs
  • Automated Image Fit
  • Easy Config With JSON
  • Faster
  • auto parse Exif data

Usage

  1. Clone this repo.

  2. Create a file config.json in root directory.

    config example:

    {
      "title": "My Blog",
      "description": "My Blog description",
      "author": "author name",
      "children": [
        {
          "title": "a dog image",
          "description": "description of this image",
          "url": "a image url"
        },
        {
          "title": "a image collection,",
          "description": "description of this collection",
          "url": "a thumbnail of this collection",
          "children": [ // a collection must have children field
            {
              "url": "a image url"
            }
          ]
        }
      ]
    }

    note:

    • The root node will be used to generate home page.
    • A image collection must have children and title field.
    • If a item is collection then generate a page for it.
    • A single image must have url field.
  3. Excute generator

    cd project_dir
    ./blog-cli
    
  4. A public directory will be created, use it as your server root

Image and Exif

There are two ways to store image: cdn or local. Only four Exif fields will be displayed:

  • focal
  • iso
  • aperture
  • shutter

CDN (recommended)

If you want show Exif of a image in cdn,you should the field:extra of its parent collection node.

A cdn url must start with http of https to distinguish from local image uri.

   "extra": {
    "image_exif_query_suffix": "?exif",
    "image_style_suffix": "$blog"
  }

image_exif_query_suffix: to fetch url exif data from cdn api. image_style_suffix: if the cdn url has a image style suffix the replace it to get original url.

note: I wrote this code because i use qiniu(七牛云),I did not handle other cdn service because they are too many.

local

  • create a directory named by image
  • put all your iamges in
  • specify the url field with prefix /image,because this mean the root of website

A local image will be extracted Exif info automatically.

Specify Exif manually

    {
        "title": "title",
        "url": "http://xx.com/ss.jpg",
        "exif": {
            "focal": "1",
            "iso": "100",
            "shutter": "1/1000",
            "aperture": "1/1"
        }
    },

Development

It is a Rust Application.

Dependencies

  • Rust Environment
  • Tera
  • Serde
  • Serde_json
  • Urlencoding

Default Values

Defined in src/config.rs

Template

The default template is template/index.html and be used by all the pages. Template Engine is Tera https://tera.netlify.app/docs/.

About

photography blog generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • SCSS 37.8%
  • CSS 33.4%
  • JavaScript 15.8%
  • Rust 7.0%
  • HTML 6.0%