Cleaning up the code of a C++-based Personal Web Page Generator I have tried to implement the following challenge:

Personal Web Page Generator
Write a program that asks the user for his or her name, then asks the user to enter a sentence that describes himself or herself. Here is an example of the program's screen:
Enter your name: Julie TaylorEnter
Describe yourself: I am a computer science major, a member of the jazz club, and I hope to work as a mobile app developer after I graduate.Enter
Once the user has entered the requested input, the program should create an HTML file, containing the input, for a simple webpage. Here is an example of the HTML content, using the sample input previously shown:
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;center&gt;
    &lt;h1&gt;Julie Taylor&lt;/h1&gt;
  &lt;/center&gt;
  &lt;hr /&gt;
  I am a computer science major, a member of the Jazz club,
  and I hope to work as a mobile app developer after I graduate.
  &lt;hr /&gt;
&lt;/body&gt;
&lt;/html&gt;


I implemented this in C++. Here is my code:
ofstream outfile_webpage;
string name, description;

outfile_webpage.open(&quot;Webpage.html&quot;);

cout &lt;&lt; &quot;Enter your name: &quot;;
getline(cin,name);

cout &lt;&lt; &quot;Describe yourself: &quot;;
getline(cin,description);

outfile_webpage &lt;&lt; &quot;&lt;html&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;&lt;head&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;&lt;/head&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;&lt;body&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;\t&lt;center&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;\t\t&lt;h1&gt;&quot; &lt;&lt; name &lt;&lt; &quot;&lt;/h1&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;\t&lt;/center&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;\t&lt;hr /&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;\t&quot; &lt;&lt; description &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;\t&lt;hr /&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;&lt;/body&gt;&quot; &lt;&lt; endl;
outfile_webpage &lt;&lt; &quot;&lt;/html&gt;&quot; &lt;&lt; endl;

outfile_webpage.close();

return 0;

This works just fine, but I see that there are a lot of repetitive lines. How can I reduce these repetitive lines?
Also, is there a way to make this code cleaner in another way, like by using a custom HTML template?
There is a lot that can be improved here.  Here are some ideas.
Don't abuse using namespace std
Putting using namespace std at the top of every program is a bad habit that you'd do well to avoid.
Use all required #includes
This code fragment uses a number of features that require included library headers.  In this case they appear to be:
#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;

It was not difficult to infer, but it helps reviewers if the code is complete.
Provide complete code to reviewers
This is not so much a change to the code as a change in how you present it to other people.  Without the full context of the code and an example of how to use it, it takes more effort for other people to understand your code.  This affects not only code reviews, but also maintenance of the code in the future, by you or by others.  One good way to address that is by the use of comments.  Another good technique is to include test code showing how your code is intended to be used.
Decompose your program into functions
All of the logic here is apparently in main in one long and repetitive chunk of code.  It would be better to decompose this into separate functions.
Don't use std::endl if you don't really need it
The difference betweeen std::endl and '\n' is that '\n' just emits a newline character, while std::endl actually flushes the stream.  This can be time-consuming in a program with a lot of I/O and is rarely actually needed.  It's best to only use std::endl when you have some good reason to flush the stream and it's not very often needed for simple programs such as this one.  Avoiding the habit of using std::endl when '\n' will do will pay dividends in the future as you write more complex programs with more I/O and where performance needs to be maximized.
Simplify and consolidate steps
Rather than having two separate lines to declare and then open the webpage file, do it in a single step:
std::ofstream webpage{&quot;Webpage.html&quot;};

Use string concatenation
The program has many repeated lines where the ostream operator&lt;&lt; is used multiple times with a fixed string.  Those multiple calls don't need to happen.  You could simply rely on the fact that C++ merges separate constant strings automatically.  For example, here is a recoded portion:
std::ofstream webpage{&quot;Webpage.html&quot;};
webpage &lt;&lt; &quot;&lt;html&gt;\n&quot; 
    &quot;&lt;head&gt;\n&quot;
    &quot;&lt;/head&gt;\n&quot;
    &quot;&lt;body&gt;\n&quot;
    &quot;\t&lt;center&gt;\n&quot;
    &quot;\t\t&lt;h1&gt;&quot; &lt;&lt; name &lt;&lt; &quot;&lt;/h1&gt;\n&quot;
    &quot;\t&lt;/center&gt;\n&quot;
    &quot;\t&lt;hr /&gt;&quot;
    &quot;\t&quot; &lt;&lt; description &lt;&lt; &quot;\n&quot;
    &quot;\t&lt;hr /&gt;&quot;
    &quot;&lt;/body&gt;&quot;
    &quot;&lt;/html&gt;&quot;;

First, HTML parsers don't care about newlines, so it really doesn't matter much if they are present or not.  Second, this is now a single explicit invocation of ostream operator&lt;&lt;.
Understand relevant standards
The HTML &lt;center&gt; tag is obsolete and should not be used.
Adding features
Using an HTML template instead is a good idea and would keep the code generic while enabling customization of use.  One way to do that would be to read in a file and then substitute special tags such as @name@ and @description@ but simply copying the rest verbatim.