【问题标题】:Inline code backtics not working内联代码反引号不起作用
【发布时间】:2017-03-15 06:30:35
【问题描述】:

我在 Digital Ocean 上创建了一个博客,使用 Nginx 作为 Web 服务器。 inline code 在 Ghosts 的预览中看起来不错,但我已经发布到网络上,内联代码看起来就像纯文本。我已经查看了代码,看不出有什么问题。有任何想法吗?谢谢你。已编辑:将 URL 添加到帖子中,以便您可以看到帖子没有内联代码的工作:https://linuxhowto.tech/managing-users-and-groups/

## Adding new users

While you can use `vipw` to edit the user configuration files, it is better to run `useradd`. 

`vim /etc/default/useradd`

The output should look similar to this:  

```  
GROUP=100  
HOME=/home    
INACTIVE=-1  
EXPIRE=    
SHELL=/bin/bash  
SKEL=/etc/skel  
CREATE_MAIL_SPOOL=yes  
```  

### Useradd examples

* `useradd -c "Comment here" sarah -s /bin/bash` sets a comment         (-c) and defines the default shell (-s)   
* `useradd bob -s /usr/sbin/nologin` sets `nologin` as the users's default shell because many users don't need shell access  
* `useradd -m -u 1201 -G ops,dev linda` adds user, adds home directory (-m), adds user to groups _ops_ and _dev_ (-G), assigns _UID 1201+ (-u)  
* `useradd` creates a locked account until you run `passwd user`  

### The login configuration file

The `/etc/login.defs` file sets the configuration for the for the _Shadow Password Suite._ The following are some of its most significant attributes:

 > * `MOTD_FILE`: Defines the file that is used as _message of the day_ file. In this file, you can include messages to be displayed after the user has successfully logged into the server.

 > * `ENV_PATH`: Defines the `$PATH` variable, a list of directories that should be searched for executable files after logging in.

 > *  `PASS_MAX_DAYS`, `PASS_MIN_DAYS`, and `PASS_WARN_AGE`: Define the default password expiration properties when creating new users.

 > *  `UID_MIN`: The first UID to use when creating new users.

 > *  `CREATE_HOME`: Indicates whether or not to create a home directory for new users.

 > * `USERGROUPS_ENAB`: Set to yes to create a private group for all new users. That means that a new user has a group with the same name as the user as its default group. If set to no, all users are made a member of the group users. [^n]

### System-wide Bash shell startup files

* `/etc/profile` runs system-wide environment variables and startup         scripts  
* `/etc/bashrc` contains system-wide aliases and functions [^n]  

### Bash shell personal startup files

While creating a user, `useradd` copies the `/etc/skel` user environment configuration files to the new user's home directory. The following are the default configuration files:

* `~/.bash_profile` contains personal environment variables and startup scripts  
* `~/.bashrc` contains personal aliases and functions  
* `~/.bash_logout` contains personal scripts to run on logout[^n]  

## Using usermod to modify users

These are a couple common use cases for `usermod`:  

* `usermod -g sales mike` adds _mike_ to sales as _primary_ group  
* `usermod -aG ops lisa` adds _lisa_ to ops as a *secondary* group  

## Managing password properties

Here are some example use cases for `passwd` and `chage`:  

* `chage -E 2018-12-31 bob` sets Bob's account to expire on a specific date  
* `chage -l linda` lists account aging information  
* `passwd -n 30 -x 90 lori -w 3` sets _minimum password age_ of 30 days, a _maximum password age_ of 90 days (-w), and starts _warning_ the user 3-days before the password expires (-w)  

## Linux group management

The `useradd` command creates a default _primary group_ with the same name as the user.  

When a user creates a file, the group owner will be set to that user's primary group. Users have access to files owned by their secondary groups. 

Use the `id` command to list a user's group memberships:  

`id linda`

The output should look something like this:  
`uid=1002(linda) gid=1003(account) groups=1003(account),1001(sales)`  

A common use case for secondary groups is to share documents between departments with a file server.  

## Creating groups

To create a new group, you can use the `vigr` command to directly modify the `/etc/group` file or you can run the `groupadd` command.

* `groupadd devs` adds a group called _dev_  
* `groupadd -g 404 devproject` adds a group called _devproject_ with _Group ID (GUID) 404_  
* `grep devproject /etc/group` to confirm that you successfully added a group  

### Modifying group membership

* `usermod -g 1003 frank` changes frank's **primary** group to      account, assigning GUID of 1003  
* `usermod -aG dev lori` adds account as a _secondary_                          group for lori  
* `usermod -g sales anouk` changes anouk's _primary_ group to sales  

---------------------------------------  
[^n]: Excerpt from Sander van Vugt's [Red Hat® RHCSA™/RHCE® 7 Cert Guide Premium Edition](http://www.sandervanvugt.com/book-red-hat-rhcsa-rhce-7-cert-guide/)  
[^n]: Derived from  [Linux From Scratch](http://www.linuxfromscratch.org/blfs/view/5.1/postlfs/profile.html)  
[^n]: Derived from  [Linux From Scratch](http://www.linuxfromscratch.org/blfs/view/5.1/postlfs/profile.html)  

【问题讨论】:

    标签: markdown ghost


    【解决方案1】:

    您似乎正在使用CSS normalization file,它正在重置内联code 标签的标准样式。因此,您可能需要添加一些额外的 CSS 来定义您希望 code 标记的外观。

    我是怎么得出这个结论的?

    首先,我检查了您输出的 HTML 源代码,并确认反引号确实被呈现为 code 标记。然后我使用我的浏览器开发工具检查其中一个code 元素(在 Chrome 上,我右键单击该元素并从上下文菜单中选择“检查”),这就是我观察到的:

    注意左侧的code 元素在底部被选中,页面上的相应文本在窗口的上半部分突出显示。然而,更重要的是底部的右栏。请注意,蓝色箭头(我添加的)指向由“用户代理样式表”定义的 CSS 规则;即没有设置其他规则时浏览器定义的默认规则。如您所见,该规则被覆盖(显示为被划掉)。这意味着另一条规则优先。如您所见,红色箭头(我添加的)指向已覆盖默认值的规则,并且该规则在名为normalize.css 的样式表中定义。向下滚动该列,我们还发现了一些从父母那里继承的规则等,但这些规则看起来并不相关。然后我单击normalize.css 文件名,浏览器打开了该文件。我滚动到顶部,找到了Normalize.css 网站的链接。

    【讨论】:

    • 感谢您的侦探工作,因为它让我困惑了整整 24 小时。我不知道为什么我没有想到 Ghost 审阅者会使用与 Ghost 主题相同的 CSS!
    • 我试图做一些其他的自定义,我自己的 CSS 覆盖了其他我不希望它覆盖的元素。我想我需要了解级联如何更精确地工作。
    • 顺便问一下,拥有 normalize.css 很重要吗?我当然会查一下,或者只是暂时禁用它看看会发生什么。我想在 diff 浏览器上发生的事情会有所不同,所以这可能是一个有趣的测试,只是为了好玩。
    【解决方案2】:

    目前,我只是切换了主题以获得快速解决方案,并且它起作用了。这些是我对 RHCSA 课程的笔记,所以我现在的目标是让它们快速上线,因为课程中的其他一些学生表示有兴趣,所以我会将我的笔记作为一系列帖子发布。在某个时候,我会在我使用的原始主题中自定义 CSS。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-21
      • 2021-07-25
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多