Skip to content

Latest commit

 

History

History
92 lines (72 loc) · 2.22 KB

4.Configuration.md

File metadata and controls

92 lines (72 loc) · 2.22 KB

Configuration

There are 2 type of configuration: application configuration and site params.

Application configuration

Application configuration is store in config/dev.exs for dev environment and config/prod.secret.exs for production environment.

Database config

You can config connection setting to your database here. This is default config for develop environment

config :chubi, Chubi.Repo,
  username: "postgres",
  password: "postgres",
  database: "chubi_dev",
  hostname: "localhost",
  pool_size: 10

Admin login credential

This is configuration for your admin account. Change username and password to yours. Chubi use Simple Auth so there is no login page, just a pop up window for you to enter username and password.

config :chubi,
  auth_config: [
    username: "admin",
    password: "123123",
    realm: "Hey! Log in to admin"
  ]

Site params

This is a sample site params. It is located at config/site_params.exs.

[
  theme: "chubi", # default theme
  locale: "en",
  format: "html", # default is markdown
  base_url: "https://example.com",
  site_params: [
    title: "Your blog title",
    sub_title: "This ",
    intro:
      "Welcome to my personal blog. My name is Dzung Nguyen, I am a full-stack web developer. That's it.",
    ga: "my code",
    author: %{
      fullname: "Dzung Nguyen",
      email: "bluesky.1289@gmail.com",
      avatar: "https://i.pravatar.cc/300",
      bio:
        "Hello! I am Dzung, I like blogging about interesting things. I don't talk much. When talking I don't have time to observe and think a bout the world."
    },
    menu: [
      main: [
        %{
          label: "Home",
          url: "/"
        },
        %{
          label: "Elixir",
          url: "/categories/elixir"
        },
        %{
          label: "Categories",
          url: "/categories"
        },
        %{
          label: "About me",
          url: "/pages/about-me"
        }
      ]
    ]
  ]
]

These are required fields:

  • theme: Theme for your blog, default is chubi theme
  • base_url: is the url which is used build your static and uploaded files url
  • site_params: These info are used in the template file via param @site_params