美文网首页Hexo
在Hexo博客中加入自定义简历页

在Hexo博客中加入自定义简历页

作者: lupeng | 来源:发表于2018-03-03 14:50 被阅读105次
    resume page

    很早就在博客里加入了简历页,那会很多信息是写死在了页面中,今天正好有空,就把页面重新调整里一下,将简历信息自定义化,相当于在此主题中正式加入简历功能。

    使用方法

    首要当然是将本主题clone到你的Hexo博客themes目录下,并且将博客配置文件_config.yml中的主题改成Hexo-theme-light_cn

    theme: Hexo-theme-light_cn
    

    然后新建page页,在source目录下新建resume目录,里面再新建index.md文件,应用resume这个布局,内容如下:

    ---
    title: Hey, It's me
    layout: resume
    ---
    
    > 思想、创作、灵感都源于阅读。
    ...
    ...
    

    访问该页面https://localhost:4000/resume,正常就能显示出来,最后修改一下该简历中左侧个人信息,这块信息,我通过theme主题里的变量自定义化了,所以你在theme_config.yml中可以看到如下信息:

    # resume
    resume_photo: /assets/img/resume/resume.jpg
    resume:
      name: 鲁 鹏
      birth: 1989年5月
      nation: 汉族
      political_status: 中共党员
      birth_place: 湖北省武汉市
      domicile_place: 北京市
      address: 北京市房山区北京理工大学良乡校区
      postcode: 102488
      email: decadent_prince@foxmail.com
      phone: 18511xxxxxx
    

    将这些数据改成你自己的即可,同时你也可以添加其他信息。例如加入一列:性别: 男,简历页左侧就会显示出来,大体功能就这样,早就该把这块功能自定义化的,一直懒...

    实现方法

    在主题中新建了resume布局,见resume.ejs文件,内容如下:

    <%- partial('_partial/head') %>
    <body>
        <header id="header">
            <%- partial('_partial/header') %>
        </header>
        <div class="resume">
            <h1 class="resume-title">
                <%- page.title %>
            </h1>
            <div class="resume-left">
                <img src="<%= theme.resume_photo %>" alt="photo">
                <% for(var i in theme.resume){ if(theme.resume[i]){%>
                    <div class="clearfix"></div>
                    <div class="resume-txt">
                        <div class="resume-little"><%- __(i) %></div>
                        <div class="resume-detail"><%= theme.resume[i] %></div>
                    </div>
                <% }} %>
            </div>
            <div class='resume-content'>
                <div class="resume-entry">
                    <%- page.content %>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        <footer id="footer">
            <%- partial('_partial/footer') %>
        </footer>
        <%- partial('_partial/after_footer') %>
    

    该布局分为两个部分,resume-left部分为可自定义部分,resume-content为简历主体内容,该部分可以自由发挥,写工作经历等等。

    相关文章

      网友评论

        本文标题:在Hexo博客中加入自定义简历页

        本文链接:https://www.haomeiwen.com/subject/fwitfftx.html